結果
問題 |
No.564 背の順
|
ユーザー |
![]() |
提出日時 | 2017-09-09 23:10:54 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 451 bytes |
コンパイル時間 | 3,719 ms |
コンパイル使用メモリ | 76,912 KB |
実行使用メモリ | 42,748 KB |
最終ジャッジ日時 | 2024-11-07 10:18:24 |
合計ジャッジ時間 | 6,619 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 WA * 3 |
ソースコード
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==1){ans="st";} else if(cnt==2){ans="nd";} else if(cnt==3){ans="rd";} System.out.println(cnt+ans); } }