# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
385681 | monus1042 | Carnival (CEOI14_carnival) | C++17 | 14 ms | 528 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 pair<int,int> ii;
#define pb push_back
const int NAX = 200;
int n;
int main(){
cin>>n;
map<int, vector<int> > g;
int curr=1;
g[1].pb(1);
for (int i=2; i<=n; i++){
cout<<i<<' ';
for (auto j=g.begin(); j!=g.end(); j++){
for (int k=0; k<j->second.size(); k++){
cout<<j->second[k]<<' ';
}
}
cout<<i;
cout<<endl;
int ans; cin>>ans;
if (ans>curr){
curr++;
g[curr].pb(i);
}else{ // it's equal
vector<ii> aux; // index, color
for (auto j=g.begin(); j!=g.end(); j++) aux.pb(ii(j->second[0], j->first));
int m=aux.size();
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... |