結果

問題 No.564 背の順
ユーザー fjafjafjafjafjafja
提出日時 2017-09-09 23:09:28
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 429 bytes
コンパイル時間 3,030 ms
コンパイル使用メモリ 76,332 KB
実行使用メモリ 42,720 KB
最終ジャッジ日時 2024-04-25 00:52:21
合計ジャッジ時間 5,214 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 123 ms
42,180 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 136 ms
42,540 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 131 ms
42,484 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++)
		{
			if(h[0]<h[i]){cnt++;}
		}
		String ans="th";
		if(cnt==1){ans="st";}
		else if(cnt==2){ans="nd";}
		else if(cnt==3){ans="rd";}
		System.out.println(cnt+ans);



	}

}
0