Submission #790991

#TimeUsernameProblemLanguageResultExecution timeMemory
7909910123xxCarnival (CEOI14_carnival)C++14
0 / 100
15 ms336 KiB
#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)

carnival.cpp: In function 'int main()':
carnival.cpp:17:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |         for (int j = 0; j< v.size(); j++) cout << v[j] << " ";
      |                         ~^~~~~~~~~~
carnival.cpp:32:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |     for (int i = 0; i< v.size(); i++){
      |                     ~^~~~~~~~~~
carnival.cpp:33:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |      for (int j = 0; j< a.size(); j++){
      |                      ~^~~~~~~~~~
#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...