結果

問題 No.564 背の順
ユーザー fal_rndfal_rnd
提出日時 2017-09-08 22:24:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 703 bytes
コンパイル時間 2,596 ms
コンパイル使用メモリ 80,064 KB
実行使用メモリ 41,420 KB
最終ジャッジ日時 2024-04-25 02:29:41
合計ジャッジ時間 4,883 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
41,360 KB
testcase_01 AC 132 ms
41,076 KB
testcase_02 AC 139 ms
41,256 KB
testcase_03 AC 131 ms
41,100 KB
testcase_04 AC 132 ms
41,420 KB
testcase_05 AC 139 ms
41,024 KB
testcase_06 AC 141 ms
41,264 KB
testcase_07 AC 132 ms
41,408 KB
testcase_08 AC 140 ms
41,412 KB
testcase_09 AC 127 ms
41,040 KB
testcase_10 AC 116 ms
40,244 KB
testcase_11 AC 129 ms
41,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.stream.IntStream;

public class Main{
	static IntStream REPS(int v){return IntStream.range(0,v);}
	static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}
	static IntStream INS(int n) {return REPS(n).map(i->getInt());}
	static Scanner s=new Scanner(System.in);
	static int getInt(){return Integer.parseInt(s.next());}

	public static void main(String[]$){
		int h=getInt(),n=getInt();
		int j=1;
		for(int l=n-1;l>0;--l)
			if(getInt()>h)
				++j;

		String r=""+j;
		switch(j%10) {
		case 1:
			r+="st";
			break;
		case 2:
			r+="nd";
			break;
		case 3:
			r+="rd";
			break;
		default:
			r+="th";
			break;
		}
		System.out.println(r);
	}
}
0