結果

問題 No.2126 MEX Game
ユーザー rlangevinrlangevin
提出日時 2023-01-26 12:40:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 348 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 86,820 KB
実行使用メモリ 90,916 KB
最終ジャッジ日時 2023-09-09 15:01:47
合計ジャッジ時間 4,559 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,892 KB
testcase_01 AC 66 ms
71,892 KB
testcase_02 AC 67 ms
71,896 KB
testcase_03 AC 66 ms
71,896 KB
testcase_04 AC 69 ms
72,012 KB
testcase_05 AC 66 ms
71,972 KB
testcase_06 AC 66 ms
72,112 KB
testcase_07 AC 66 ms
72,072 KB
testcase_08 AC 65 ms
71,976 KB
testcase_09 AC 65 ms
72,088 KB
testcase_10 AC 86 ms
90,916 KB
testcase_11 AC 86 ms
90,728 KB
testcase_12 AC 90 ms
90,704 KB
testcase_13 AC 88 ms
90,788 KB
testcase_14 AC 85 ms
90,576 KB
testcase_15 AC 86 ms
90,496 KB
testcase_16 AC 86 ms
90,676 KB
testcase_17 AC 86 ms
90,248 KB
testcase_18 AC 88 ms
90,616 KB
testcase_19 AC 86 ms
89,752 KB
testcase_20 AC 85 ms
89,620 KB
testcase_21 AC 89 ms
90,804 KB
testcase_22 AC 70 ms
71,924 KB
testcase_23 AC 70 ms
71,888 KB
testcase_24 AC 72 ms
72,008 KB
testcase_25 WA -
testcase_26 AC 69 ms
71,952 KB
testcase_27 AC 72 ms
71,960 KB
testcase_28 AC 71 ms
72,120 KB
testcase_29 AC 68 ms
72,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
M = 101010
D = [0] * M
for a in A:
    D[a] += 1

ans = 0
for i in range(M):
    if D[i] >= 2:
        ans = i + 1
        N -= min(2, D[i])        
    elif D[i] >= 1 and N - D[i] >= 1:
        ans = i + 1
        N -= min(2, D[i])
        D[i + 1] -= 1     
    else:
        break
print(ans) 
0