結果

問題 No.564 背の順
ユーザー tetsutetsu
提出日時 2017-09-08 22:26:21
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 567 bytes
コンパイル時間 4,639 ms
コンパイル使用メモリ 76,380 KB
実行使用メモリ 41,848 KB
最終ジャッジ日時 2024-04-24 20:29:12
合計ジャッジ時間 5,306 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
41,076 KB
testcase_01 AC 106 ms
41,180 KB
testcase_02 AC 137 ms
41,408 KB
testcase_03 WA -
testcase_04 AC 126 ms
41,420 KB
testcase_05 AC 135 ms
41,736 KB
testcase_06 AC 121 ms
41,344 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 111 ms
41,272 KB
testcase_10 AC 128 ms
41,524 KB
testcase_11 AC 117 ms
41,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yuki173;

import java.util.Scanner;

public class A {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int N = sc.nextInt();
		int rank = 1;
		for(int i=0; i<N-1; i++) {
			if(sc.nextInt() < H) {
				;
			} else {
				rank++;
			}
		}
		sc.close();
		if(rank == 1) {
			System.out.println("1st");
		} else if(rank == 2) {
			System.out.println("2nd");
		} else if(rank == 3) {
			System.out.println("3rd");
		} else {
			System.out.println(rank + "th");
		}
	}

}
0