Submission #155640

#TimeUsernameProblemLanguageResultExecution timeMemory
155640AkashiCarnival (CEOI14_carnival)C++14
100 / 100
26 ms404 KiB
#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)

carnival.cpp: In function 'int main()':
carnival.cpp:31:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int p = 0; p < v.size() ; ++p){
                            ~~^~~~~~~~~~
carnival.cpp:33:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 if(p == v.size() - 1){
                    ~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...