Submission #575038

# Submission time Handle Problem Language Result Execution time Memory
575038 2022-06-09T14:32:56 Z Uzouf Carnival (CEOI14_carnival) C++14
0 / 100
1 ms 272 KB
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
#define ll long long
//#define endl "\n"
//int mod=1e9+7;
//const int N=2e5+5;
//template<class x>
//using ordered_multiset = tree<x, null_type,less_equal<x>, rb_tree_tag,tree_order_statistics_node_update>;

int n,c;
int col[155];

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen(".in", "r", stdin); freopen(".out", "w", stdout);

    cin>>n;

    set<int> ask;
    ask.insert(1); col[1]=1; c=1;

    for (int i=2;i<=n;i++) {

      cout<<ask.size()+1<<' ';
      auto j=ask.begin();
      while (j!=ask.end()) {
        cout<<*j<<' ';
        j++;
      }

      cout<<i<<endl;
      fflush(stdout);
      int nm; cin>>nm;

      if (nm!=ask.size()+1) {
        auto j=ask.begin();
        while (j!=ask.end()) {
          cout<<*j<<' '<<i<<endl;
          fflush(stdout);
          int gg; cin>>gg;
          if (gg==1) {
            ask.erase(*j); col[i]=col[*j];
            break;
          }
          j++;
        }
      }
      else {
        c++; col[i]=c;
      }
      ask.insert(i);
    }

    cout<<0<<' ';
    for(int i=1;i<=n;i++) {
      cout<<col[i]<<' ';
    }
}

Compilation message

carnival.cpp: In function 'int main()':
carnival.cpp:38:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::set<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |       if (nm!=ask.size()+1) {
      |           ~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Execution timed out 1 ms 272 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1 ms 208 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1 ms 208 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1 ms 208 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1 ms 208 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -