結果

問題 No.564 背の順
コンテスト
ユーザー fjafjafja
提出日時 2017-09-09 23:13:36
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 460 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,581 ms
コンパイル使用メモリ 83,136 KB
実行使用メモリ 46,904 KB
最終ジャッジ日時 2026-05-07 18:30:49
合計ジャッジ時間 4,292 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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