Submission #2210904
Source Code Expand
import java.util.HashMap; import java.util.Map.Entry; import java.util.Scanner; import java.util.List; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); HashMap<Integer, Integer> map = new HashMap<>(); int counta = 1; for (int i = 0; i < a; i++) { map.put(counta, sc.nextInt()); counta++; } List<Entry<Integer, Integer>> list_entries = new ArrayList<Entry<Integer, Integer>>(map.entrySet()); Collections.sort(list_entries, new Comparator<Entry<Integer, Integer>>() { public int compare(Entry<Integer, Integer> obj1, Entry<Integer, Integer> obj2) { return obj2.getValue().compareTo(obj1.getValue()); } }); for (Entry<Integer, Integer> entry : list_entries) { System.out.println(entry.getKey()); } sc.close(); } }
Submission Info
Submission Time | |
---|---|
Task | C - 背の順 |
User | guksg |
Language | Java8 (OpenJDK 1.8.0) |
Score | 100 |
Code Size | 940 Byte |
Status | AC |
Exec Time | 1185 ms |
Memory | 77844 KB |
Judge Result
Set Name | Sample | Subtask1 | All | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 30 / 30 | 70 / 70 | ||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt |
Subtask1 | 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt |
All | 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 2_00.txt, 2_01.txt, 2_02.txt, 2_03.txt, 2_04.txt, 2_05.txt, 2_06.txt, 2_07.txt, 2_08.txt, 2_09.txt, 2_10.txt, 2_11.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 91 ms | 19796 KB |
0_01.txt | AC | 92 ms | 20560 KB |
0_02.txt | AC | 94 ms | 21332 KB |
1_00.txt | AC | 92 ms | 21844 KB |
1_01.txt | AC | 93 ms | 20692 KB |
1_02.txt | AC | 94 ms | 19540 KB |
1_03.txt | AC | 91 ms | 19924 KB |
1_04.txt | AC | 159 ms | 23920 KB |
1_05.txt | AC | 177 ms | 23520 KB |
1_06.txt | AC | 184 ms | 22812 KB |
1_07.txt | AC | 171 ms | 26756 KB |
1_08.txt | AC | 171 ms | 26072 KB |
1_09.txt | AC | 178 ms | 26692 KB |
1_10.txt | AC | 174 ms | 26324 KB |
1_11.txt | AC | 175 ms | 22880 KB |
1_12.txt | AC | 181 ms | 26700 KB |
1_13.txt | AC | 181 ms | 24536 KB |
1_14.txt | AC | 170 ms | 21204 KB |
1_15.txt | AC | 111 ms | 20820 KB |
2_00.txt | AC | 1060 ms | 72932 KB |
2_01.txt | AC | 1062 ms | 72036 KB |
2_02.txt | AC | 1107 ms | 69440 KB |
2_03.txt | AC | 1171 ms | 77844 KB |
2_04.txt | AC | 1155 ms | 67844 KB |
2_05.txt | AC | 1185 ms | 68032 KB |
2_06.txt | AC | 1159 ms | 69644 KB |
2_07.txt | AC | 1166 ms | 68848 KB |
2_08.txt | AC | 1013 ms | 62532 KB |
2_09.txt | AC | 1115 ms | 67588 KB |
2_10.txt | AC | 608 ms | 44832 KB |
2_11.txt | AC | 1030 ms | 64132 KB |