結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
GodNegoto
|
| 提出日時 | 2019-11-29 14:47:46 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 618 bytes |
| コンパイル時間 | 3,979 ms |
| コンパイル使用メモリ | 77,132 KB |
| 実行使用メモリ | 42,072 KB |
| 最終ジャッジ日時 | 2024-11-20 21:19:13 |
| 合計ジャッジ時間 | 6,590 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 3 |
ソースコード
package algo;
import java.util.*;
public class sample7 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
List<Integer> list = new ArrayList<Integer>();
int H = sc.nextInt();
list.add(H);
int N = sc.nextInt();
for(int i = 1; i < N; i++) {
list.add(sc.nextInt());
}
Collections.sort(list);
Collections.reverse(list);
int r = list.indexOf(H) + 1;
switch (r) {
case 1:
System.out.println("1st");
break;
case 2:
System.out.println("2nd");
break;
case 3:
System.out.println("3rd");
break;
default:
System.out.println(r + "th");
}
}
}
GodNegoto