結果

問題 No.504 ゲーム大会(ランキング)
ユーザー tenten
提出日時 2020-09-11 09:07:35
言語 Java
(openjdk 23)
結果
AC  
実行時間 722 ms / 2,000 ms
コード長 470 bytes
コンパイル時間 2,283 ms
コンパイル使用メモリ 74,428 KB
実行使用メモリ 49,056 KB
最終ジャッジ日時 2024-12-25 02:48:14
合計ジャッジ時間 10,035 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	int base = sc.nextInt();
    	StringBuilder sb = new StringBuilder();
    	sb.append("1\n");
    	int rank = 1;
    	for (int i = 1; i < n; i++) {
    	    int x = sc.nextInt();
    	    if (base < x) {
    	        rank++;
    	    }
    	    sb.append(rank).append("\n");
    	}
    	System.out.print(sb);
	}
}
0