Submission #3609163
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); int N = scanner.nextInt(); int M = scanner.nextInt(); 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++) { P[i] = scanner.nextInt(); Y[i] = scanner.nextInt(); 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 | 1172 Byte |
Status | TLE |
Exec Time | 2110 ms |
Memory | 179664 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 | 1933 ms | 167336 KB |
02.txt | TLE | 2107 ms | 94300 KB |
03.txt | AC | 125 ms | 24532 KB |
04.txt | AC | 94 ms | 21716 KB |
05.txt | TLE | 2105 ms | 98236 KB |
06.txt | AC | 1966 ms | 166632 KB |
07.txt | AC | 239 ms | 28816 KB |
08.txt | AC | 1958 ms | 158160 KB |
09.txt | AC | 1976 ms | 170840 KB |
10.txt | TLE | 2110 ms | 110504 KB |
11.txt | TLE | 2041 ms | 169712 KB |
12.txt | AC | 1854 ms | 106576 KB |
13.txt | AC | 1910 ms | 144624 KB |
14.txt | AC | 1994 ms | 166276 KB |
15.txt | AC | 1925 ms | 166280 KB |
16.txt | TLE | 2103 ms | 179664 KB |
17.txt | AC | 1978 ms | 169184 KB |
18.txt | TLE | 2034 ms | 169272 KB |
sample_01.txt | AC | 97 ms | 20052 KB |
sample_02.txt | AC | 97 ms | 21332 KB |
sample_03.txt | AC | 99 ms | 20692 KB |