#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 |
16 ms |
200 KB |
Output is correct |
2 |
Correct |
26 ms |
256 KB |
Output is correct |
3 |
Correct |
24 ms |
308 KB |
Output is correct |
4 |
Correct |
8 ms |
200 KB |
Output is correct |
5 |
Correct |
6 ms |
200 KB |
Output is correct |
6 |
Correct |
5 ms |
200 KB |
Output is correct |
7 |
Correct |
23 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
200 KB |
Output is correct |
2 |
Correct |
32 ms |
200 KB |
Output is correct |
3 |
Correct |
24 ms |
200 KB |
Output is correct |
4 |
Correct |
9 ms |
200 KB |
Output is correct |
5 |
Correct |
12 ms |
200 KB |
Output is correct |
6 |
Correct |
13 ms |
200 KB |
Output is correct |
7 |
Correct |
14 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 |
Partially correct |
31 ms |
200 KB |
Partially correct |
4 |
Correct |
6 ms |
200 KB |
Output is correct |
5 |
Correct |
12 ms |
200 KB |
Output is correct |
6 |
Correct |
20 ms |
200 KB |
Output is correct |
7 |
Correct |
24 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
200 KB |
Output is correct |
2 |
Correct |
11 ms |
200 KB |
Output is correct |
3 |
Correct |
25 ms |
200 KB |
Output is correct |
4 |
Correct |
6 ms |
200 KB |
Output is correct |
5 |
Correct |
34 ms |
200 KB |
Output is correct |
6 |
Correct |
20 ms |
200 KB |
Output is correct |
7 |
Correct |
32 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
200 KB |
Output is correct |
2 |
Correct |
20 ms |
200 KB |
Output is correct |
3 |
Partially correct |
44 ms |
200 KB |
Partially correct |
4 |
Correct |
21 ms |
304 KB |
Output is correct |
5 |
Correct |
17 ms |
300 KB |
Output is correct |
6 |
Correct |
20 ms |
304 KB |
Output is correct |
7 |
Correct |
12 ms |
200 KB |
Output is correct |