# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
790991 | 0123xx | Carnival (CEOI14_carnival) | C++14 | 15 ms | 336 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, cur = 1, res, oldres, l, r, m;
vector<int> v, a;
vector<int> adj[155];
int ans[155];
int main(){
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> n;
oldres = 0;
for (int i = 1; i<= n; i++){
ans[i] = i;
}
for (int i = 1; i<= n; i++){
cout << cur << " ";
for (int j = 0; j< v.size(); j++) cout << v[j] << " ";
cout << i;
cout << endl;
cin >> res;
if (res > oldres){
//rew costume
v.push_back(i);
cur++;
}
else{
//repeat
a.push_back(i);
}
oldres = res;
}
for (int i = 0; i< v.size(); i++){
for (int j = 0; j< a.size(); j++){
cout << "2 " << v[i] << " " << a[j] << endl;
cin >> res;
if (res == 1) ans[a[j]] = ans[v[i]];
}
}
cout << "0";
for (int i = 1; i<= n; i++) {
cout << " " << ans[i];
}
cout << endl;
}
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... |