Submission #99250

#TimeUsernameProblemLanguageResultExecution timeMemory
99250HellAngelCarnival (CEOI14_carnival)C++14
0 / 100
2 ms384 KiB
#include <bits/stdc++.h> using namespace std; const int maxn = 1000; int n, m, mark[1000], type[maxn], cnt = -1, dem; int Ask(int l, int r) { cout << r - l + 1 << ' '; for(int i = l; i <= r; i++) cout << i << ' '; cout << endl; fflush(stdout); int x; cin >> x; return x; } int Ask1(int x, int y) { cout << 2 << ' '; cout << x << ' ' << y << endl; fflush(stdout); int z; cin >> z; return z; } void Ans() { cout << 0 << ' '; for(int i = 1; i <= n; i++) cout << type[i] << ' '; cout << endl; fflush(stdout); } int 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++) { int New = Ask(1, i); if(New == old + 1) { mark[i] = 1; } 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[j] = cnt; } } } } Ans(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...