Submission #99245

#TimeUsernameProblemLanguageResultExecution timeMemory
99245HellAngelCarnival (CEOI14_carnival)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define int long long using namespace std; const int maxn = 1000; int n, m, mark[1000], type[maxn], cur = -1; int Ask(int l, int r) { cout << r - l + 1 << endl; for(int i = l; i <= r; i++) cout << i << ' '; cout << endl; int x; cin >> x; return x; } int Ask1(int x, int y) { cout << 2 << endl; cout << x << ' ' << y << endl; int z; cin >> z; return z; } void Ans() { cout << 0 << endl; for(int i = 1; i <= n; i++) cout << type[i] << ' '; cout << endl; } int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); //freopen("test.inp", "r", stdin);freopen("test.out", "w", stdout); fill_n(type, maxn, -1); int old = 0; for(int i = 1; i <= n; i++) { mark[i] = mark[i - 1]; int New = Ask(1, i); if(New == old + 1) { mark[i]++; } old = New; } for(int i = 1; i <= n; i++) { if(mark[i]) { type[i] = ++cnt; int t = i + 1; for(; t <= n && !mark[t]; t++) { if(type[t] == -1) type[t] = cnt; } for(int j = t; j <= n; j++) { if(!mark[j] && type[j] == -1 && Ask1(i, j) == 1) { type[i] = cur; } } } } Ans(); }

Compilation message (stderr)

carnival.cpp: In function 'int32_t main()':
carnival.cpp:54:25: error: 'cnt' was not declared in this scope
             type[i] = ++cnt;
                         ^~~
carnival.cpp:54:25: note: suggested alternative: 'int'
             type[i] = ++cnt;
                         ^~~
                         int