結果

問題 No.2092 Conjugation
ユーザー viral8
提出日時 2022-10-07 22:26:08
言語 Java
(openjdk 23)
結果
AC  
実行時間 1,233 ms / 2,000 ms
コード長 549 bytes
コンパイル時間 2,812 ms
コンパイル使用メモリ 76,640 KB
実行使用メモリ 70,132 KB
最終ジャッジ日時 2024-06-12 19:23:15
合計ジャッジ時間 17,329 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] sum = new int[(int)1e5+1];
        while(N-->0){
            int A = sc.nextInt();
            sum[A]++;
        }
        for(int i=(int)1e5-1;i>0;i--){
            sum[i] += sum[i+1];
        }
        int p = 1;
        while(p<=1e5){
            if(sum[p]==0)
                break;
            System.out.print(sum[p++]+" ");
        }
        System.out.println();
    }
}
0