結果

問題 No.564 背の順
コンテスト
ユーザー fjafjafja
提出日時 2017-09-09 23:13:36
言語 Java
(openjdk 27 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
AC  
実行時間 162 ms / 2,000 ms
+ 694µs
コード長 460 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,561 ms
コンパイル使用メモリ 95,900 KB
実行使用メモリ 48,760 KB
最終ジャッジ日時 2026-10-15 18:22:38
合計ジャッジ時間 7,251 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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