結果

問題 No.2335 Jump
ユーザー flygonflygon
提出日時 2023-06-02 21:33:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 360 bytes
コンパイル時間 959 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 91,436 KB
最終ジャッジ日時 2023-08-28 02:49:23
合計ジャッジ時間 3,566 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,468 KB
testcase_01 AC 89 ms
71,580 KB
testcase_02 AC 92 ms
71,528 KB
testcase_03 AC 90 ms
71,544 KB
testcase_04 AC 90 ms
71,572 KB
testcase_05 AC 92 ms
71,872 KB
testcase_06 AC 91 ms
71,576 KB
testcase_07 AC 91 ms
71,628 KB
testcase_08 AC 90 ms
71,808 KB
testcase_09 AC 90 ms
71,648 KB
testcase_10 AC 90 ms
71,624 KB
testcase_11 AC 90 ms
71,516 KB
testcase_12 AC 113 ms
91,228 KB
testcase_13 AC 114 ms
91,364 KB
testcase_14 AC 115 ms
91,300 KB
testcase_15 AC 115 ms
91,044 KB
testcase_16 AC 114 ms
91,208 KB
testcase_17 AC 112 ms
90,448 KB
testcase_18 AC 113 ms
91,180 KB
testcase_19 AC 114 ms
91,436 KB
testcase_20 AC 110 ms
90,308 KB
testcase_21 AC 114 ms
90,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

n = int(input())
a = list(map(int,input().split()))

ans = 0
for i in range(n-1):
    ans += a[i+1] - a[i] - 1

ans += a[0]-1
print(ans)
0