結果

問題 No.564 背の順
ユーザー shinwisteriashinwisteria
提出日時 2018-02-15 23:09:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 497 bytes
コンパイル時間 5,844 ms
コンパイル使用メモリ 73,900 KB
実行使用メモリ 56,524 KB
最終ジャッジ日時 2023-08-28 16:28:40
合計ジャッジ時間 5,970 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
55,964 KB
testcase_01 AC 135 ms
56,192 KB
testcase_02 AC 144 ms
55,988 KB
testcase_03 AC 137 ms
56,136 KB
testcase_04 AC 134 ms
55,936 KB
testcase_05 AC 143 ms
56,012 KB
testcase_06 AC 144 ms
55,996 KB
testcase_07 AC 138 ms
55,960 KB
testcase_08 AC 144 ms
56,524 KB
testcase_09 AC 137 ms
55,844 KB
testcase_10 AC 135 ms
56,372 KB
testcase_11 AC 135 ms
56,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Con564 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int H = s.nextInt() , N = s.nextInt();
		int count = 1;
		for(int i = 0;i < N-1;i++){
			int h = s.nextInt();
			if(h > H){
				count++;
			}
		}
		s.close();
		String rank = count + "th";
		switch(count % 10){
		case 1:rank = count +"st";
		break;
		case 2:rank = count + "nd";
		break;
		case 3:rank = count + "rd";
		break;
		}
		System.out.println(rank);

	}

}
0