結果

問題 No.564 背の順
ユーザー yohei-kuyohei-ku
提出日時 2018-03-28 00:23:48
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 786 bytes
コンパイル時間 64 ms
コンパイル使用メモリ 6,528 KB
実行使用メモリ 6,092 KB
最終ジャッジ日時 2023-09-07 19:15:16
合計ジャッジ時間 877 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
5,980 KB
testcase_01 AC 10 ms
5,976 KB
testcase_02 AC 10 ms
6,020 KB
testcase_03 WA -
testcase_04 AC 11 ms
5,864 KB
testcase_05 AC 11 ms
6,016 KB
testcase_06 AC 10 ms
5,996 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 10 ms
5,976 KB
testcase_10 WA -
testcase_11 AC 11 ms
5,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,N = map(int,raw_input().split())
H_ALL =[]
for i in range(0,N-1):
    X = raw_input()
    H_ALL.append(int(X))
H_ALL.sort(reverse=True)

for i in range(0,N-1):
    if H > H_ALL[i]:
        if (i+1) == 1:
            print str(i+1)+'st'
            break
        elif (i+1) == 2:
            print str(i+1)+'nd'
            break
        elif (i+1) == 3:
            print str(i+1)+'rd'
            break
        else:
            print str(i+1)+'th'
            break
            
    elif i==N-2:
        if (i+1) == 1:
            print str(i+2)+'st'
            break
        elif (i+1) == 2:
            print str(i+2)+'nd'
            break
        elif (i+1) == 3:
            print str(i+2)+'rd'
            break
        else:
            print str(i+2)+'th'
            break
0