Submission #3609060
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 | 1300 Byte |
Status | TLE |
Exec Time | 2110 ms |
Memory | 175360 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 | 1974 ms | 172456 KB |
02.txt | TLE | 2105 ms | 140304 KB |
03.txt | AC | 125 ms | 24012 KB |
04.txt | AC | 93 ms | 20692 KB |
05.txt | TLE | 2109 ms | 153380 KB |
06.txt | AC | 1818 ms | 172120 KB |
07.txt | AC | 254 ms | 30472 KB |
08.txt | AC | 1918 ms | 164468 KB |
09.txt | AC | 1896 ms | 171100 KB |
10.txt | TLE | 2110 ms | 167668 KB |
11.txt | AC | 1934 ms | 165116 KB |
12.txt | AC | 1643 ms | 160344 KB |
13.txt | AC | 1851 ms | 160056 KB |
14.txt | AC | 1925 ms | 169444 KB |
15.txt | AC | 1858 ms | 171352 KB |
16.txt | AC | 1970 ms | 170724 KB |
17.txt | AC | 1826 ms | 169388 KB |
18.txt | AC | 1979 ms | 175360 KB |
sample_01.txt | AC | 94 ms | 20948 KB |
sample_02.txt | AC | 95 ms | 21588 KB |
sample_03.txt | AC | 97 ms | 21460 KB |