結果

問題 No.564 背の順
ユーザー fjafjafjafjafjafja
提出日時 2017-09-09 23:13:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 174 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 4,007 ms
コンパイル使用メモリ 76,472 KB
実行使用メモリ 42,540 KB
最終ジャッジ日時 2024-04-25 00:52:55
合計ジャッジ時間 6,549 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 166 ms
42,132 KB
testcase_01 AC 149 ms
41,956 KB
testcase_02 AC 173 ms
42,144 KB
testcase_03 AC 167 ms
42,296 KB
testcase_04 AC 165 ms
42,304 KB
testcase_05 AC 174 ms
42,392 KB
testcase_06 AC 170 ms
42,524 KB
testcase_07 AC 170 ms
42,540 KB
testcase_08 AC 173 ms
42,436 KB
testcase_09 AC 168 ms
42,344 KB
testcase_10 AC 166 ms
42,312 KB
testcase_11 AC 168 ms
42,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class N564 {

	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
		int hh=sc.nextInt(),N=sc.nextInt();
		int[] h=new int[N];
		h[0]=hh;
		int cnt=1;
		for(int i=1;i<N;i++)
		{
			h[i]=sc.nextInt();
			if(h[0]<h[i]){cnt++;}
		}
		String ans="th";
		if(cnt%10==1){ans="st";}
		else if(cnt%10==2){ans="nd";}
		else if(cnt%10==3){ans="rd";}
		System.out.println(cnt+ans);



	}

}
0