Submission #818892

#TimeUsernameProblemLanguageResultExecution timeMemory
818892Faisal_SaqibCarnival (CEOI14_carnival)C++17
0 / 100
12 ms208 KiB
#include <iostream> #include <set> #include <vector> using namespace std; int main() { int n; cin>>n; int val[n+3]; set<int> head; for(int i=1;i<=n;i++) { val[i]=i; } head.insert(1); for(int i=2;i<=n;i++) { cout<<head.size()+1; for(auto j:head) { cout<<' '<<j; } cout<<' '<<i<<endl; int c; cin>>c; if(c==head.size()) { for(auto j:head) { cout<<2<<' '<<j<<' '<<i<<endl; cin>>c; if(c==1) { val[i]=val[j]; break; } } } else { head.insert(i); } } cout<<0; for(int i=1;i<=n;i++) { cout<<' '<<val[i]; } cout<<endl; return 0; }

Compilation message (stderr)

carnival.cpp: In function 'int main()':
carnival.cpp:26:7: warning: comparison of integer expressions of different signedness: 'int' and 'std::set<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |   if(c==head.size())
      |      ~^~~~~~~~~~~~~
#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...