結果

問題 No.564 背の順
ユーザー fjafjafja
提出日時 2017-09-09 23:13:36
言語 Java
(openjdk 23)
結果
AC  
実行時間 174 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 3,560 ms
コンパイル使用メモリ 76,352 KB
実行使用メモリ 42,676 KB
最終ジャッジ日時 2024-11-07 10:18:33
合計ジャッジ時間 6,389 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

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