結果

問題 No.2053 12345...
ユーザー pluto77pluto77
提出日時 2023-01-22 15:43:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 207 ms / 2,000 ms
コード長 140 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 29,876 KB
最終ジャッジ日時 2023-09-07 01:51:55
合計ジャッジ時間 6,445 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,848 KB
testcase_01 AC 16 ms
7,932 KB
testcase_02 AC 18 ms
8,252 KB
testcase_03 AC 58 ms
12,784 KB
testcase_04 AC 152 ms
22,976 KB
testcase_05 AC 45 ms
11,252 KB
testcase_06 AC 138 ms
21,152 KB
testcase_07 AC 93 ms
17,244 KB
testcase_08 AC 95 ms
16,616 KB
testcase_09 AC 162 ms
22,928 KB
testcase_10 AC 207 ms
28,436 KB
testcase_11 AC 44 ms
10,724 KB
testcase_12 AC 31 ms
9,608 KB
testcase_13 AC 194 ms
27,396 KB
testcase_14 AC 69 ms
14,108 KB
testcase_15 AC 67 ms
13,368 KB
testcase_16 AC 61 ms
12,916 KB
testcase_17 AC 49 ms
11,364 KB
testcase_18 AC 206 ms
29,644 KB
testcase_19 AC 160 ms
23,812 KB
testcase_20 AC 28 ms
9,576 KB
testcase_21 AC 96 ms
17,044 KB
testcase_22 AC 17 ms
8,252 KB
testcase_23 AC 34 ms
10,336 KB
testcase_24 AC 59 ms
13,508 KB
testcase_25 AC 177 ms
27,464 KB
testcase_26 AC 89 ms
17,180 KB
testcase_27 AC 60 ms
13,432 KB
testcase_28 AC 52 ms
12,216 KB
testcase_29 AC 121 ms
20,804 KB
testcase_30 AC 57 ms
12,844 KB
testcase_31 AC 117 ms
20,232 KB
testcase_32 AC 199 ms
29,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
res=0
x=0
for i in range(N):
 while x<N and A[x]==A[i]+(x-i):
  x+=1
 res+=x-i-1
print(res)
0