結果
問題 |
No.564 背の順
|
ユーザー |
|
提出日時 | 2022-03-05 14:54:55 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 42 ms / 2,000 ms |
コード長 | 351 bytes |
コンパイル時間 | 200 ms |
コンパイル使用メモリ | 82,164 KB |
実行使用メモリ | 52,480 KB |
最終ジャッジ日時 | 2024-07-19 19:38:40 |
合計ジャッジ時間 | 1,315 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
h,n = map(int,input().split()) array = [h] + [int(input()) for i in range(n-1)] array_s = list(sorted(array))[::-1] index = array_s.index(h)+1 result = int(str(index)[-1]) if result==1: print("{}st".format(index)) elif result==2: print("{}nd".format(index)) elif result==3: print("{}rd".format(index)) else: print("{}th".format(index))