# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
155640 | Akashi | Carnival (CEOI14_carnival) | C++14 | 26 ms | 404 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;
int n;
vector <int> v;
int a[155];
bool f[155];
int main()
{
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
cin >> n;
int NR = 0, x;
a[1] = ++NR;
v.push_back(1);
for(int i = 2; i <= n ; ++i){
cout << v.size() + 1 << " ";
for(auto it : v) cout << it << " ";
cout << i;
cout << endl;
cin >> x;
if(x == NR){
memset(f, 0, sizeof(f));
shuffle(v.begin(), v.end(), rng);
for(int p = 0; p < v.size() ; ++p){
int it = v[p];
if(p == v.size() - 1){
a[i] = a[it];
break ;
}
cout << 2 << " ";
cout << i << " " << it << endl;
cin >> x;
if(x == 1){
a[i] = a[it];
break ;
}
}
}
else{
v.push_back(i);
a[i] = ++NR;
}
}
cout << 0 << " ";
for(int i = 1; i <= n ; ++i) cout << a[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... |