結果

問題 No.1686 Geschenkt
ユーザー ygd.ygd.
提出日時 2021-09-24 21:27:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 71,544 KB
最終ジャッジ日時 2023-09-18 20:39:32
合計ジャッジ時間 1,669 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,336 KB
testcase_01 AC 72 ms
71,544 KB
testcase_02 AC 71 ms
71,148 KB
testcase_03 AC 73 ms
71,424 KB
testcase_04 AC 72 ms
71,384 KB
testcase_05 AC 72 ms
71,392 KB
testcase_06 AC 71 ms
71,348 KB
testcase_07 AC 69 ms
71,356 KB
testcase_08 AC 72 ms
71,404 KB
testcase_09 AC 72 ms
71,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.buffer.readline


def main():
    N = int(input()); INF = pow(10,18)
    A = [-INF] + list(map(int,input().split()))
    A.sort()
    ans = 0
    for i in range(1,N+1):
        if A[i-1] + 1 == A[i]: continue
        ans += A[i]
    print(ans)
    

if __name__ == '__main__':
    main()
0