# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
220735 | 2020-04-08T13:49:49 Z | csamoila | Carnival (CEOI14_carnival) | C++17 | 11 ms | 384 KB |
#include <iostream> #include <vector> using namespace std; int n; int F[151]; int COLOUR[151]; vector <int> SEFI; int C; int main() { cin >> n; SEFI.push_back(1); F[1]=1; COLOUR[1]=1; for(int i=2;i<=n;i++) { cout << SEFI.size()+1 << ' '; for(auto x : SEFI) { cout << x << ' '; } cout << i << '\n'; int q; cin >> q; if(q==SEFI.size()+1) { SEFI.push_back(i); F[i]=1; COLOUR[i]=q; } } C=SEFI.size(); for(int i=1;i<=n;i++) { if(F[i]==0) { int st=1,dr=n; int rez=0; while(st<=dr) { int mij=(st+dr)/2; cout << mij+1 << ' '; for(int j=0;j!=mij;j++) { cout << SEFI[j] << ' '; } cout << i << '\n'; int q; cin >> q; if(q==mij+1) { st=mij+1; } else { rez=mij; dr=mij-1; } } COLOUR[i]=COLOUR[rez]; } } cout << 0 << ' '; for(int i=1;i<=n;i++) cout << COLOUR[i] << ' '; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 384 KB | Integer 0 violates the range [1, 137] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 256 KB | Integer 0 violates the range [1, 145] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 256 KB | Integer 0 violates the range [1, 133] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 11 ms | 360 KB | Integer 0 violates the range [1, 143] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 384 KB | Integer 0 violates the range [1, 149] |
2 | Halted | 0 ms | 0 KB | - |