結果

問題 No.2335 Jump
ユーザー 倉
提出日時 2023-06-02 22:11:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 589 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 91,520 KB
最終ジャッジ日時 2023-08-28 03:49:52
合計ジャッジ時間 4,207 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
72,556 KB
testcase_01 AC 114 ms
72,336 KB
testcase_02 AC 113 ms
72,584 KB
testcase_03 AC 113 ms
72,368 KB
testcase_04 AC 110 ms
72,292 KB
testcase_05 AC 109 ms
72,492 KB
testcase_06 AC 110 ms
72,444 KB
testcase_07 AC 112 ms
72,488 KB
testcase_08 AC 109 ms
72,516 KB
testcase_09 AC 110 ms
72,396 KB
testcase_10 AC 110 ms
72,200 KB
testcase_11 AC 111 ms
72,512 KB
testcase_12 AC 134 ms
91,328 KB
testcase_13 AC 132 ms
91,308 KB
testcase_14 AC 136 ms
91,288 KB
testcase_15 AC 132 ms
91,520 KB
testcase_16 AC 131 ms
91,288 KB
testcase_17 AC 130 ms
90,508 KB
testcase_18 AC 132 ms
91,488 KB
testcase_19 AC 132 ms
91,316 KB
testcase_20 AC 131 ms
90,480 KB
testcase_21 AC 131 ms
90,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from functools import partial
# import pypyjit
# pypyjit.set_param('max_unroll_recursion = -1')

sys.setrecursionlimit(500005)
stdin = sys.stdin

ns = lambda: stdin.readline().strip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nz = lambda: list(map(lambda x: int(x)-1, stdin.readline().split())) # 遅い
printa = partial(print, sep="\n") # printa(*A) で各要素を改行して出力
mod = 1000000007 # 998244353
inf = 10 ** 18

N = ni()
A = na()

A.insert(0, 0)

ans = 0
for i in range(1, N+1)[::-1]:
    ans += A[i] - A[i-1] - 1

print(ans)
0