結果
| 問題 | No.564 背の順 |
| コンテスト | |
| ユーザー |
aikon_marimo
|
| 提出日時 | 2018-02-03 22:02:22 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 62 ms / 2,000 ms |
| + 675µs | |
| コード長 | 515 bytes |
| 記録 | |
| コンパイル時間 | 1,490 ms |
| コンパイル使用メモリ | 85,296 KB |
| 実行使用メモリ | 43,264 KB |
| 最終ジャッジ日時 | 2026-07-25 21:42:26 |
| 合計ジャッジ時間 | 3,345 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int H = in.nextInt();
int N = in.nextInt();
int ans = 1;
for (int i = 0; i < N-1; i++) {
int hi = in.nextInt();
if (H < hi) {
ans++;
}
}
if (ans%10 == 1) {
System.out.println(ans + "st");
} else if (ans%10 == 2) {
System.out.println(ans + "nd");
} else if (ans%10 == 3) {
System.out.println(ans + "rd");
} else {
System.out.println(ans + "th");
}
}
}
aikon_marimo