Submission #1232460
Source Code Expand
import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = Integer.parseInt(scanner.next()); long[] a = new long[N]; long[] b = new long[N]; Set<Long> set = new HashSet<Long>(); Map<Long, Integer> map = new HashMap<Long, Integer>(); for (int i = 0; i < N; i++) { a[i] = Integer.parseInt(scanner.next()); if (!set.contains(a[i])) { set.add(a[i]); } } Long[] setArray = set.toArray(new Long[set.size()]); Arrays.sort(setArray); for (int i = 0; i < setArray.length; i++) { map.put(setArray[i], i); } for (int i = 0; i < N; i++) { System.out.println(map.get(a[i])); } } }
Submission Info
Submission Time | |
---|---|
Task | C - 座圧 |
User | mitar |
Language | Java8 (OpenJDK 1.8.0) |
Score | 100 |
Code Size | 875 Byte |
Status | AC |
Exec Time | 1307 ms |
Memory | 79344 KB |
Judge Result
Set Name | Testset1 | Testset2 | All | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 30 / 30 | 30 / 30 | 40 / 40 | ||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Testset1 | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt |
Testset2 | 000.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt |
All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, 027.txt, 028.txt, 029.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | AC | 90 ms | 21460 KB |
001.txt | AC | 164 ms | 24260 KB |
002.txt | AC | 166 ms | 19792 KB |
003.txt | AC | 174 ms | 23784 KB |
004.txt | AC | 167 ms | 22440 KB |
005.txt | AC | 164 ms | 24512 KB |
006.txt | AC | 179 ms | 24572 KB |
007.txt | AC | 176 ms | 25720 KB |
008.txt | AC | 162 ms | 24516 KB |
009.txt | AC | 170 ms | 25256 KB |
010.txt | AC | 1003 ms | 60824 KB |
011.txt | AC | 900 ms | 46736 KB |
012.txt | AC | 1036 ms | 60992 KB |
013.txt | AC | 913 ms | 51760 KB |
014.txt | AC | 1133 ms | 79344 KB |
015.txt | AC | 1012 ms | 61316 KB |
016.txt | AC | 960 ms | 52844 KB |
017.txt | AC | 1051 ms | 65848 KB |
018.txt | AC | 1011 ms | 64792 KB |
019.txt | AC | 997 ms | 58388 KB |
020.txt | AC | 1246 ms | 76700 KB |
021.txt | AC | 1071 ms | 66264 KB |
022.txt | AC | 943 ms | 53928 KB |
023.txt | AC | 1283 ms | 78456 KB |
024.txt | AC | 1140 ms | 69144 KB |
025.txt | AC | 943 ms | 47728 KB |
026.txt | AC | 995 ms | 54348 KB |
027.txt | AC | 1107 ms | 72888 KB |
028.txt | AC | 942 ms | 55628 KB |
029.txt | AC | 1307 ms | 78588 KB |