結果
問題 |
No.564 背の順
|
ユーザー |
![]() |
提出日時 | 2018-11-03 02:14:44 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 27 ms / 2,000 ms |
コード長 | 574 bytes |
コンパイル時間 | 306 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-20 18:19:52 |
合計ジャッジ時間 | 1,327 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
# -*- coding: utf-8 -*- import sys def main(): h, m = [int(i) for i in sys.stdin.readline().split()] l = [int(sys.stdin.readline()) for _ in range(m - 1)] l.append(h) n = sorted(l, reverse=True) result = 0 for i in range(len(n)): if n[i] == h: result = i + 1 break s = str(result)[-1] t = "" if s == "1": t = "st" elif s == "2": t = "nd" elif s == "3": t = "rd" else: t = "th" print(str(result) + t) if __name__ == '__main__': main()