結果

問題 No.504 ゲーム大会(ランキング)
ユーザー tentententen
提出日時 2020-09-11 09:07:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 649 ms / 2,000 ms
コード長 470 bytes
コンパイル時間 2,158 ms
コンパイル使用メモリ 71,588 KB
実行使用メモリ 61,244 KB
最終ジャッジ日時 2023-08-26 08:51:15
合計ジャッジ時間 9,702 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,756 KB
testcase_01 AC 124 ms
56,068 KB
testcase_02 AC 127 ms
55,800 KB
testcase_03 AC 126 ms
56,184 KB
testcase_04 AC 126 ms
55,784 KB
testcase_05 AC 127 ms
55,760 KB
testcase_06 AC 126 ms
56,144 KB
testcase_07 AC 644 ms
61,180 KB
testcase_08 AC 616 ms
60,904 KB
testcase_09 AC 649 ms
61,036 KB
testcase_10 AC 637 ms
60,808 KB
testcase_11 AC 621 ms
61,244 KB
testcase_12 AC 554 ms
60,428 KB
testcase_13 AC 553 ms
60,644 KB
testcase_14 AC 639 ms
60,692 KB
権限があれば一括ダウンロードができます

ソースコード

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