結果

問題 No.564 背の順
ユーザー tetsu
提出日時 2017-09-08 22:26:21
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 567 bytes
コンパイル時間 5,392 ms
コンパイル使用メモリ 86,276 KB
実行使用メモリ 42,024 KB
最終ジャッジ日時 2024-11-07 05:23:31
合計ジャッジ時間 6,716 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 3
権限があれば一括ダウンロードができます

ソースコード

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