結果
| 問題 | No.564 背の順 |
| コンテスト | |
| ユーザー |
kokatsu
|
| 提出日時 | 2022-08-01 21:16:55 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 390 bytes |
| 記録 | |
| コンパイル時間 | 1,827 ms |
| コンパイル使用メモリ | 209,524 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-22 15:56:25 |
| 合計ジャッジ時間 | 2,412 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
import std;
void main() {
int H, N;
readf("%d %d\n", H, N);
auto T = new int[](N-1);
foreach (i; 0 .. N-1) readf("%d\n", T[i]);
auto S = T.sort;
auto ub = S.upperBound(H);
int res = ub.length.to!int + 1;
string ord = "th";
if (res % 10 == 1) ord = "st";
if (res % 10 == 2) ord = "nd";
if (res % 10 == 3) ord = "rd";
writeln(res, ord);
}
kokatsu