結果

問題 No.1686 Geschenkt
ユーザー shinichishinichi
提出日時 2021-09-24 21:35:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 216 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 71,860 KB
最終ジャッジ日時 2023-09-18 20:51:58
合計ジャッジ時間 1,963 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,696 KB
testcase_01 AC 90 ms
71,508 KB
testcase_02 AC 94 ms
71,448 KB
testcase_03 AC 91 ms
71,860 KB
testcase_04 AC 92 ms
71,476 KB
testcase_05 AC 92 ms
71,560 KB
testcase_06 AC 92 ms
71,624 KB
testcase_07 AC 93 ms
71,756 KB
testcase_08 AC 93 ms
71,456 KB
testcase_09 AC 94 ms
71,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter


N = int(input())
A = list(map(int, input().split()))
counter = Counter(A)

ans = 0
for key, value in counter.items():
    if not counter[key-1]:
        ans += value * key
print(ans)
0