結果
問題 |
No.564 背の順
|
ユーザー |
![]() |
提出日時 | 2017-09-09 23:09:28 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 429 bytes |
コンパイル時間 | 3,694 ms |
コンパイル使用メモリ | 76,280 KB |
実行使用メモリ | 42,844 KB |
最終ジャッジ日時 | 2024-11-07 10:18:02 |
合計ジャッジ時間 | 6,294 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 2 WA * 7 |
ソースコード
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); } }