Submission #1689154


Source Code Expand

import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int[] a=new int[n];
		int[] abuf=new int[n];
		for(int i=0;i<n;i++){
			a[i]=sc.nextInt();
		}
		abuf=a.clone();
		Arrays.sort(a);
		HashMap<Integer,Integer> hm=new HashMap<Integer,Integer>();
		int pre=-1;
		int value=0;
		for(int i=0;i<n;i++){
			if(pre==a[i]){
				continue;
			}else{
				hm.put(a[i],value++);
				pre=a[i];
			}
		}
		for(int i=0;i<n;i++){
			System.out.println(hm.get(abuf[i]));
		}
	}

}

Submission Info

Submission Time
Task C - 座圧
User ri2112
Language Java8 (OpenJDK 1.8.0)
Score 100
Code Size 638 Byte
Status AC
Exec Time 1270 ms
Memory 76668 KB

Judge Result

Set Name Testset1 Testset2 All
Score / Max Score 30 / 30 30 / 30 40 / 40
Status
AC × 10
AC × 11
AC × 30
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 100 ms 21844 KB
001.txt AC 175 ms 24352 KB
002.txt AC 183 ms 25932 KB
003.txt AC 176 ms 26944 KB
004.txt AC 180 ms 27504 KB
005.txt AC 162 ms 25176 KB
006.txt AC 175 ms 25784 KB
007.txt AC 177 ms 26448 KB
008.txt AC 182 ms 25816 KB
009.txt AC 190 ms 24484 KB
010.txt AC 1064 ms 65324 KB
011.txt AC 1069 ms 67076 KB
012.txt AC 1040 ms 64148 KB
013.txt AC 1009 ms 63056 KB
014.txt AC 1099 ms 69876 KB
015.txt AC 1052 ms 62308 KB
016.txt AC 998 ms 63460 KB
017.txt AC 1145 ms 71392 KB
018.txt AC 1078 ms 66024 KB
019.txt AC 1051 ms 65116 KB
020.txt AC 1194 ms 74804 KB
021.txt AC 1155 ms 72332 KB
022.txt AC 1177 ms 70772 KB
023.txt AC 1151 ms 67348 KB
024.txt AC 1270 ms 76668 KB
025.txt AC 1104 ms 63232 KB
026.txt AC 1102 ms 64580 KB
027.txt AC 1156 ms 65720 KB
028.txt AC 1066 ms 63092 KB
029.txt AC 1105 ms 70236 KB