Submission #533514

# Submission time Handle Problem Language Result Execution time Memory
533514 2022-03-06T08:24:56 Z kebine Carnival (CEOI14_carnival) C++17
100 / 100
28 ms 308 KB
#include <bits/stdc++.h>
using namespace std;

#define nyahalo ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define otsumiko exit(0);
#define mikodanye priority_queue<pair<long long, long long>, vector<pair<long long, long long> >, greater<pair<long long, long long> > >
#define mikochi priority_queue<long long, vector<long long>, greater<long long> >

int main() {
  nyahalo
  long long pv = 1, n, cr, tmp;
  cin >> n;
  vector<long long> v;
  long long cl[n+1];
  v.push_back(1);
  cl[1] = 1;
  for (long long i=2; i<=n; i++) {
    cout << i;
    for (long long j=1; j<=i; j++) {
      cout << " " << j;
    }
    cout << "\n";
    cout << flush;
    cin >> cr;
    if (cr == pv) {
      for (long long j=0; j<v.size(); j++) {
        cout << "2 " << v[j] << " " << i << "\n" << flush;
        cin >> tmp;
        if (tmp == 1) {
          cl[i] = j+1;
          break;
        }
      }
    } else {
      v.push_back(i);
      cl[i] = cr;
    }
    pv = cr;
  }
  cout << "0";
  for (long long i=1; i<=n; i++) {
    cout << " " << cl[i];
  }
  cout << "\n" << flush;
  otsumiko
}

Compilation message

carnival.cpp: In function 'int main()':
carnival.cpp:26:28: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |       for (long long j=0; j<v.size(); j++) {
      |                           ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 10 ms 200 KB Output is correct
2 Correct 19 ms 200 KB Output is correct
3 Correct 13 ms 200 KB Output is correct
4 Correct 4 ms 200 KB Output is correct
5 Correct 5 ms 200 KB Output is correct
6 Correct 4 ms 200 KB Output is correct
7 Correct 12 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 200 KB Output is correct
2 Correct 18 ms 200 KB Output is correct
3 Correct 13 ms 200 KB Output is correct
4 Correct 8 ms 200 KB Output is correct
5 Correct 4 ms 200 KB Output is correct
6 Correct 4 ms 200 KB Output is correct
7 Correct 7 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 200 KB Output is correct
2 Correct 5 ms 200 KB Output is correct
3 Correct 28 ms 200 KB Output is correct
4 Correct 5 ms 200 KB Output is correct
5 Correct 5 ms 200 KB Output is correct
6 Correct 3 ms 200 KB Output is correct
7 Correct 20 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 200 KB Output is correct
2 Correct 7 ms 200 KB Output is correct
3 Correct 11 ms 200 KB Output is correct
4 Correct 5 ms 200 KB Output is correct
5 Correct 2 ms 200 KB Output is correct
6 Correct 4 ms 308 KB Output is correct
7 Correct 13 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 200 KB Output is correct
2 Correct 11 ms 200 KB Output is correct
3 Correct 8 ms 308 KB Output is correct
4 Correct 15 ms 200 KB Output is correct
5 Correct 6 ms 308 KB Output is correct
6 Correct 3 ms 200 KB Output is correct
7 Correct 7 ms 308 KB Output is correct