結果

問題 No.1686 Geschenkt
ユーザー ygd.
提出日時 2021-09-24 21:27:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 81,748 KB
実行使用メモリ 52,096 KB
最終ジャッジ日時 2024-07-05 10:02:09
合計ジャッジ時間 1,051 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

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