結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-02-27 22:19:35 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 2,000 ms |
| コード長 | 396 bytes |
| コンパイル時間 | 271 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 52,352 KB |
| 最終ジャッジ日時 | 2024-11-30 11:56:39 |
| 合計ジャッジ時間 | 1,401 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
#!/usr/bin/env python
hn = [int(x) for x in input().split()]
hlist = [hn[0]]
for i in range(hn[1]-1):
hlist.append(int(input()))
hlist.sort(reverse=True)
ind = hlist.index(hn[0]) + 1
if str(ind)[-1] == '1':
print('{0}st'.format(ind))
elif str(ind)[-1] == '2':
print('{0}nd'.format(ind))
elif str(ind)[-1] == '3':
print('{0}rd'.format(ind))
else:
print('{0}th'.format(ind))