Submission #444983

#TimeUsernameProblemLanguageResultExecution timeMemory
444983fuad27Carnival (CEOI14_carnival)C++14
0 / 100
186 ms200 KiB
#include<bits/stdc++.h> using namespace std; int r; int p(int a, int b) { cout<<b-a+1<<' '; for(int i = a;i<=b;i++)cout<<i<<' '; cout<<"\n"; fflush(stdout); cin >> r; return r; } int main () { int n; cin >> n; int A[160] = {0}; int m = 0; for(int i = 1;i<=n;i++) { if(i == 1) { A[i] = ++m; } else if(p(1, i) == p(1, i-1)+1) { A[i] = ++m; } else { int ans = 0; for(int j = 1;j<=i-1;j++) { if(p(j, i) == p(j, i-1) + 1)continue; else ans = j; } A[i] = A[ans]; } } A[0] = 0; for(int i = 0;i<=n;i++) { cout<<A[i]<<' '; } cout<<'\n'; fflush(stdout); return 0; }
#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...