結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-08 22:23:41 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 141 ms / 2,000 ms |
| コード長 | 886 bytes |
| コンパイル時間 | 3,875 ms |
| コンパイル使用メモリ | 77,804 KB |
| 実行使用メモリ | 41,888 KB |
| 最終ジャッジ日時 | 2024-11-07 12:01:26 |
| 合計ジャッジ時間 | 5,895 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
import java.io.*;
import java.util.*;
public class Main_yukicoder564 {
private static Scanner sc;
private static Printer pr;
private static void solve() {
int h = sc.nextInt();
int n = sc.nextInt();
int[] hh = new int[n - 1];
int cnt = 1;
for (int i = 0; i < n - 1; i++) {
hh[i] = sc.nextInt();
if (hh[i] > h) {
cnt++;
}
}
if (cnt % 10 == 1) {
pr.printf("%dst\n", cnt);
} else if (cnt % 10 == 2) {
pr.printf("%dnd\n", cnt);
} else if (cnt % 10 == 3) {
pr.printf("%drd\n", cnt);
} else {
pr.printf("%dth\n", cnt);
}
}
// ---------------------------------------------------
public static void main(String[] args) {
sc = new Scanner(System.in);
pr = new Printer(System.out);
solve();
pr.close();
sc.close();
}
private static class Printer extends PrintWriter {
Printer(PrintStream out) {
super(out);
}
}
}