답안 #791011

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
791011 2023-07-23T10:55:03 Z 0123xx 사육제 (CEOI14_carnival) C++14
100 / 100
15 ms 220 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[ans[i]] == true) continue;
    	tr[ans[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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 208 KB Output is correct
2 Correct 14 ms 208 KB Output is correct
3 Correct 12 ms 208 KB Output is correct
4 Correct 2 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
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 208 KB Output is correct
2 Correct 15 ms 208 KB Output is correct
3 Correct 7 ms 208 KB Output is correct
4 Correct 6 ms 208 KB Output is correct
5 Correct 4 ms 208 KB Output is correct
6 Correct 2 ms 208 KB Output is correct
7 Correct 4 ms 208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 208 KB Output is correct
2 Correct 5 ms 208 KB Output is correct
3 Correct 10 ms 208 KB Output is correct
4 Correct 3 ms 208 KB Output is correct
5 Correct 2 ms 208 KB Output is correct
6 Correct 3 ms 208 KB Output is correct
7 Correct 15 ms 208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 208 KB Output is correct
2 Correct 6 ms 208 KB Output is correct
3 Correct 7 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 13 ms 208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 208 KB Output is correct
2 Correct 11 ms 208 KB Output is correct
3 Correct 13 ms 208 KB Output is correct
4 Correct 11 ms 220 KB Output is correct
5 Correct 5 ms 208 KB Output is correct
6 Correct 3 ms 208 KB Output is correct
7 Correct 3 ms 208 KB Output is correct