Submission #1105234

#TimeUsernameProblemLanguageResultExecution timeMemory
1105234APersonCarnival (CEOI14_carnival)Java
20 / 100
940 ms21068 KiB
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(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...