結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,528 KB
testcase_01 AC 93 ms
71,484 KB
testcase_02 AC 94 ms
71,624 KB
testcase_03 AC 94 ms
71,856 KB
testcase_04 AC 95 ms
71,656 KB
testcase_05 AC 92 ms
71,868 KB
testcase_06 AC 93 ms
71,588 KB
testcase_07 AC 93 ms
71,604 KB
testcase_08 AC 92 ms
71,496 KB
testcase_09 AC 93 ms
71,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
from collections import defaultdict, deque
import heapq
import bisect

stdin=sys.stdin
sys.setrecursionlimit(10 ** 8)

ip=lambda: int(sp())
fp=lambda: float(sp())
lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()
Yp=lambda:print('Yes')
Np=lambda:print('No')
inf = 1 << 60
eps = 1e-9
sortkey = itemgetter(0)

###############################################################
N = ip()
A = lp()
score = [0 for _ in range(50)]
ans = 0
for get in A:
    score[get] += 1

for i in range(1,50):
    if score[i] == 1:
        if score[i - 1] == 0:
            ans += i
print(ans)
0