# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
445803 | JovanB | Carnival (CEOI14_carnival) | C++17 | 10 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int col[155];
vector <int> vec;
void trazi(int l, int r, int k){
if(l == r){
col[k] = col[vec[l]];
return;
}
int mid = (l+r)/2;
cout << mid-l+2 << " ";
for(int i=l; i<=mid; i++){
cout << vec[i] << " ";
}
cout << k << endl;
int x;
cin >> x;
if(x != mid-l+2) trazi(l, mid, k);
else trazi(mid+1, r, k);
}
int main(){
ios_base::sync_with_stdio(false);
cout.precision(10);
cout<<fixed;
int n;
cin >> n;
col[1] = 1;
vec.push_back(1);
for(int i=2; i<=n; i++){
cout << vec.size() + 1 << " ";
for(auto c : vec) cout << c << " ";
cout << i << endl;
int x;
cin >> x;
if(x > vec.size()){
col[i] = vec.size() + 1;
vec.push_back(i);
continue;
}
trazi(0, vec.size()-1, i);
}
cout << "0 ";
for(int i=1; i<=n; i++) cout << col[i] << " ";
cout << endl;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |