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];
ArrayList<Integer> change = new ArrayList<>();
change.add(1);
confirmed[0] = 1;
int curNum = 1;
for(int i = 1; i < n; i++) {
StringBuilder s = new StringBuilder();
s.append(i + 1);
for(int j = 0; j <= i; j++) s.append(" ").append(j + 1);
System.out.println(s); System.out.flush();
int next = sc.nextInt();
if(next > curNum) {
confirmed[i] = next;
curNum = next;
change.add(i + 1);
}
}
for(int i = 1; i < n; i++) {
if(confirmed[i] != 0) continue;
for(int j = 0; j < change.size(); j++) {
System.out.print(2 + " " + (i + 1) + " " + change.get(j));
System.out.flush();
if(sc.nextInt() == 1) {
confirmed[i] = j + 1;
break;
}
}
}
System.out.print(0);
for(int i : confirmed) {
System.out.print(" " + i);
}
System.out.flush();
sc.close();
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
185 ms |
16400 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
210 ms |
16876 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
179 ms |
16288 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
201 ms |
17220 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
200 ms |
17152 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |