Submission #3609180
Source Code Expand
import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String[] temp = scanner.nextLine().split(" "); int N = Integer.valueOf(temp[0]); int M = Integer.valueOf(temp[1]); int[] P = new int[M]; int[] Y = new int[M]; List<List<Integer>> prefList = new ArrayList<>(); for (int i = 0; i < N; i++) { prefList.add(new ArrayList<>()); } for (int i = 0; i < M; i++) { temp = scanner.nextLine().split(" "); P[i] = Integer.valueOf(temp[0]); Y[i] = Integer.valueOf(temp[1]); List<Integer> list = prefList.get(P[i]-1); list.add(Y[i]); } for (List<Integer> list: prefList) { Collections.sort(list); } for (int i = 0; i < M; i++) { List<Integer> list = prefList.get(P[i]-1); int index = list.indexOf(Y[i]); System.out.println(padLeft(P[i]) + padLeft(index+1)); } } public static String padLeft(int i) { return String.format("%06d", i); } }
Submission Info
Submission Time | |
---|---|
Task | C - ID |
User | hitting1024 |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 1298 Byte |
Status | TLE |
Exec Time | 2109 ms |
Memory | 175408 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 1871 ms | 168160 KB |
02.txt | TLE | 2109 ms | 138340 KB |
03.txt | AC | 126 ms | 27988 KB |
04.txt | AC | 90 ms | 18644 KB |
05.txt | TLE | 2109 ms | 150540 KB |
06.txt | AC | 1922 ms | 173200 KB |
07.txt | AC | 287 ms | 30636 KB |
08.txt | AC | 1874 ms | 165880 KB |
09.txt | AC | 1849 ms | 170384 KB |
10.txt | TLE | 2107 ms | 163516 KB |
11.txt | AC | 1829 ms | 167548 KB |
12.txt | AC | 1967 ms | 175408 KB |
13.txt | AC | 1870 ms | 161288 KB |
14.txt | AC | 1882 ms | 167524 KB |
15.txt | AC | 1904 ms | 170584 KB |
16.txt | AC | 1916 ms | 171136 KB |
17.txt | AC | 1869 ms | 172004 KB |
18.txt | AC | 1973 ms | 172016 KB |
sample_01.txt | AC | 92 ms | 23380 KB |
sample_02.txt | AC | 92 ms | 18768 KB |
sample_03.txt | AC | 93 ms | 20948 KB |