Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define e1 first
- #define e2 second
- #define pb push_back
- #define mp make_pair
- #define boost ios_base::sync_with_stdio(false)
- #define maxn 300100
- #define OUT(v) {cout << v; exit(0); }
- typedef long long int ll;
- typedef unsigned long long ull;
- typedef pair <int, int> PII;
- typedef pair <ll, ll> PLL;
- typedef pair <PII, PII> PP;
- typedef unsigned int ui;
- const int mod = 1e9+7;
- const int inf = 1e9+9;
- const ll MOD = 1e9+696969;
- const ll INF = 1e18+3;
- int cost[150];
- int main()
- {
- cost[1] = cost[0] = 0;
- for (int i=2; i<=144; ++i)
- {
- int dp = inf;
- int pol = (i / 2);
- for (int j=1; j<=pol; ++j)
- {
- dp = min(dp, max(cost[j] + 2, cost[i - j] + 1));
- }
- cost[i] = dp;
- }
- int ile;
- scanf("%d", &ile);
- if (ile < cost[144]) OUT("Not enough money");
- puts("Let's play!");
- vector <int> elems;
- string s;
- for (int i=1; i<=144; ++i) elems.push_back(i);
- while (elems.size() > 1)
- {
- int i = elems.size();
- vector <int> nowy;
- nowy.clear();
- int pol = (i / 2);
- for (int j=1; j<=pol; ++j)
- if (max(cost[j] + 2, cost[i - j] + 1) == cost[i])
- {
- fflush(stdout);
- printf("%d ", j);
- for (int help = 0; help < j; ++help) printf("%d ", elems[help]);
- printf("\n");
- cin >> s;
- if (s == "Yes") for (int help = 0; help < j; ++help) nowy.pb(elems[help]);
- else for (int help = j; help < i; ++help) nowy.pb(elems[help]);
- break;
- }
- elems.clear();
- for (int j=0; j<nowy.size(); ++j) elems.push_back(nowy[j]);
- }
- cout << "0 "<< *elems.begin();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement