import java.util.*;
public class carnival {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] confirmed = new int[n];
int curNum = 1;
for(int i = 0; i < n; i++) {
if(confirmed[i] != 0) continue;
confirmed[i] = curNum;
for(int j = i + 1; j < n; j++) {
if(confirmed[j] != 0) continue;
System.out.println(2 + " " + (i + 1) + " " + (j + 1)); System.out.flush();
int num = sc.nextInt();
if(num == 1) confirmed[j] = curNum;
}
curNum++;
}
System.out.print(0);
for(int i : confirmed) {
System.out.print(" " + i);
}
System.out.flush();
sc.close();
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
212 ms |
16440 KB |
Output is correct |
2 |
Correct |
354 ms |
16916 KB |
Output is correct |
3 |
Partially correct |
739 ms |
20768 KB |
Partially correct |
4 |
Partially correct |
827 ms |
20800 KB |
Partially correct |
5 |
Correct |
171 ms |
16408 KB |
Output is correct |
6 |
Correct |
151 ms |
16396 KB |
Output is correct |
7 |
Correct |
318 ms |
16908 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
180 ms |
16412 KB |
Output is correct |
2 |
Correct |
349 ms |
16920 KB |
Output is correct |
3 |
Partially correct |
514 ms |
17444 KB |
Partially correct |
4 |
Partially correct |
810 ms |
20904 KB |
Partially correct |
5 |
Correct |
174 ms |
16364 KB |
Output is correct |
6 |
Correct |
177 ms |
16508 KB |
Output is correct |
7 |
Correct |
213 ms |
16528 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
160 ms |
16888 KB |
Output is correct |
2 |
Correct |
222 ms |
16432 KB |
Output is correct |
3 |
Partially correct |
503 ms |
17820 KB |
Partially correct |
4 |
Partially correct |
893 ms |
20452 KB |
Partially correct |
5 |
Correct |
217 ms |
16692 KB |
Output is correct |
6 |
Correct |
232 ms |
16668 KB |
Output is correct |
7 |
Correct |
407 ms |
17344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
166 ms |
16604 KB |
Output is correct |
2 |
Correct |
183 ms |
16300 KB |
Output is correct |
3 |
Partially correct |
752 ms |
20532 KB |
Partially correct |
4 |
Partially correct |
887 ms |
20684 KB |
Partially correct |
5 |
Correct |
252 ms |
16812 KB |
Output is correct |
6 |
Correct |
439 ms |
17376 KB |
Output is correct |
7 |
Correct |
366 ms |
16948 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
182 ms |
16464 KB |
Output is correct |
2 |
Correct |
312 ms |
17164 KB |
Output is correct |
3 |
Partially correct |
727 ms |
21068 KB |
Partially correct |
4 |
Partially correct |
764 ms |
20844 KB |
Partially correct |
5 |
Correct |
470 ms |
17900 KB |
Output is correct |
6 |
Partially correct |
728 ms |
20776 KB |
Partially correct |
7 |
Partially correct |
940 ms |
20832 KB |
Partially correct |