跳到正文

题解

题解:P15893 [TOPC 2025] Take It or Double It

s12316约 1 分钟
原文
文章信息与版本

文章信息

收录
2026年3月28日
更新
2026年3月28日
篇幅
约 1 分钟
题目
P15893

版本

  1. v1当前

思路:


很简单的一道题,只需判断当前金额加倍之后是否超过预算即可。

正解:


C++
#include<bits/stdc++.h>
#define int long long
using namespace std;
int a,b;
signed main()
{
	cin>>a>>b;
	if(a*2>b) cout<<"take it";
	else cout<<"double it";
	return 0;
}
原文