Submission #3609093
Source Code Expand
import java.util.ArrayList; 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); int index = list.size(); for (int j = 0; j < list.size(); j++) { Integer item = list.get(j); if (item > Y[i]) { index = j; break; } } list.add(index, Y[i]); } 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 | 1450 Byte |
Status | TLE |
Exec Time | 2110 ms |
Memory | 176116 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 | 1873 ms | 171440 KB |
02.txt | TLE | 2110 ms | 80372 KB |
03.txt | AC | 117 ms | 25940 KB |
04.txt | AC | 92 ms | 20692 KB |
05.txt | TLE | 2109 ms | 73288 KB |
06.txt | TLE | 2047 ms | 176116 KB |
07.txt | AC | 260 ms | 30848 KB |
08.txt | AC | 1885 ms | 163708 KB |
09.txt | AC | 1919 ms | 171252 KB |
10.txt | TLE | 2105 ms | 99104 KB |
11.txt | TLE | 2110 ms | 171100 KB |
12.txt | TLE | 2110 ms | 134564 KB |
13.txt | TLE | 2110 ms | 171340 KB |
14.txt | AC | 1871 ms | 168968 KB |
15.txt | AC | 1907 ms | 170888 KB |
16.txt | AC | 1897 ms | 173932 KB |
17.txt | AC | 1930 ms | 171112 KB |
18.txt | AC | 1921 ms | 170728 KB |
sample_01.txt | AC | 93 ms | 21076 KB |
sample_02.txt | AC | 91 ms | 21972 KB |
sample_03.txt | AC | 96 ms | 21332 KB |