結果

問題 No.504 ゲーム大会(ランキング)
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-11 00:35:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,112 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 1,785 ms
コンパイル使用メモリ 74,096 KB
実行使用メモリ 58,500 KB
最終ジャッジ日時 2024-04-24 11:35:34
合計ジャッジ時間 12,011 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
41,500 KB
testcase_01 AC 119 ms
41,600 KB
testcase_02 AC 116 ms
41,152 KB
testcase_03 AC 115 ms
41,308 KB
testcase_04 AC 113 ms
41,388 KB
testcase_05 AC 124 ms
41,560 KB
testcase_06 AC 123 ms
41,492 KB
testcase_07 AC 1,112 ms
57,988 KB
testcase_08 AC 1,025 ms
58,488 KB
testcase_09 AC 1,030 ms
58,044 KB
testcase_10 AC 1,036 ms
58,024 KB
testcase_11 AC 1,055 ms
58,056 KB
testcase_12 AC 1,108 ms
58,500 KB
testcase_13 AC 942 ms
58,060 KB
testcase_14 AC 1,020 ms
58,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int rank = 1;
		int score = 0;
		for (int i=0; i<n; i++) {
			if (i==0) {
				score = sc.nextInt();
				System.out.println(rank);
			}
			else {
				if (score < sc.nextInt()) {rank++; System.out.println(rank);}
				else {System.out.println(rank);}
			}
		}
	}
}
0