Submission #791009

# Submission time Handle Problem Language Result Execution time Memory
791009 2023-07-23T10:52:34 Z 0123xx Carnival (CEOI14_carnival) C++14
84 / 100
32 ms 316 KB
#include <bits/stdc++.h>
using namespace std;
int n, cur = 2, oldres, l, r, m;
vector<int> v, a;
vector<int> adj[155];
int ans[155], res[155];
bool tr[155];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cin >> n;
    oldres = 0;
    ans[1] = 1;
    for (int i = 1; i<= n; i++){
    	cout << i << " ";
    	for (int j = 1; j<= i; j++){
    		cout << j;
    		if (j < i) cout << " ";
		}
		cout << endl;
		cin >> res[i];
		if (res[i] != res[i-1]){
			ans[i] = cur;
			cur++;
		}
    }
    for (int i = 1; i<= n; i++){
    	if (tr[i] == true) continue;
    	tr[i] = true;
    	for (int j = i+1; j<= n; j++){
    		if (ans[j] > 0) continue;
    		cout << "2 " << j << " " << i << endl;
    		cin >> oldres;
    		if (oldres == 1) ans[j] = ans[i];
		}
	}
	cout << "0";
	for (int i = 1; i<= n; i++) cout << " " << ans[i]-1;
	cout << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 9 ms 208 KB Output is correct
2 Correct 9 ms 316 KB Output is correct
3 Correct 16 ms 208 KB Output is correct
4 Correct 4 ms 208 KB Output is correct
5 Correct 5 ms 284 KB Output is correct
6 Correct 3 ms 208 KB Output is correct
7 Correct 16 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 208 KB Output is correct
2 Correct 21 ms 208 KB Output is correct
3 Correct 13 ms 208 KB Output is correct
4 Correct 5 ms 208 KB Output is correct
5 Correct 3 ms 208 KB Output is correct
6 Correct 3 ms 208 KB Output is correct
7 Correct 8 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 208 KB Output is correct
2 Correct 11 ms 208 KB Output is correct
3 Partially correct 32 ms 208 KB Partially correct
4 Correct 4 ms 208 KB Output is correct
5 Correct 4 ms 208 KB Output is correct
6 Correct 3 ms 208 KB Output is correct
7 Correct 23 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 208 KB Output is correct
2 Correct 5 ms 208 KB Output is correct
3 Correct 9 ms 208 KB Output is correct
4 Correct 4 ms 208 KB Output is correct
5 Correct 3 ms 208 KB Output is correct
6 Correct 4 ms 208 KB Output is correct
7 Correct 15 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 208 KB Output is correct
2 Correct 13 ms 208 KB Output is correct
3 Correct 20 ms 208 KB Output is correct
4 Correct 19 ms 208 KB Output is correct
5 Correct 5 ms 208 KB Output is correct
6 Correct 3 ms 208 KB Output is correct
7 Correct 6 ms 208 KB Output is correct