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

· · 题解

思路:

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

正解:

#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;
}