結果

問題 No.564 背の順
ユーザー shinwisteria
提出日時 2018-02-15 23:06:21
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 488 bytes
コンパイル時間 4,061 ms
コンパイル使用メモリ 77,436 KB
実行使用メモリ 42,024 KB
最終ジャッジ日時 2024-12-29 20:38:47
合計ジャッジ時間 7,031 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;
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){
		case 1:rank = "1st";
		break;
		case 2:rank = "2nd";
		break;
		case 3:rank = "3rd";
		break;
		}
		System.out.println(rank);

	}

}
0