結果

問題 No.2053 12345...
ユーザー gr1msl3ygr1msl3y
提出日時 2022-08-24 22:38:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 153 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 104,832 KB
最終ジャッジ日時 2024-04-20 11:01:21
合計ジャッジ時間 4,484 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,968 KB
testcase_01 AC 38 ms
52,224 KB
testcase_02 AC 48 ms
59,904 KB
testcase_03 AC 54 ms
70,144 KB
testcase_04 AC 80 ms
94,744 KB
testcase_05 AC 60 ms
67,968 KB
testcase_06 AC 90 ms
90,752 KB
testcase_07 AC 68 ms
82,432 KB
testcase_08 AC 66 ms
79,616 KB
testcase_09 AC 79 ms
94,592 KB
testcase_10 AC 106 ms
104,832 KB
testcase_11 AC 54 ms
67,456 KB
testcase_12 AC 51 ms
64,512 KB
testcase_13 AC 97 ms
103,936 KB
testcase_14 AC 63 ms
74,752 KB
testcase_15 AC 59 ms
72,320 KB
testcase_16 AC 59 ms
71,424 KB
testcase_17 AC 57 ms
68,864 KB
testcase_18 AC 109 ms
101,632 KB
testcase_19 AC 81 ms
94,592 KB
testcase_20 AC 49 ms
63,360 KB
testcase_21 AC 67 ms
81,152 KB
testcase_22 AC 46 ms
59,776 KB
testcase_23 AC 50 ms
64,376 KB
testcase_24 AC 58 ms
70,784 KB
testcase_25 AC 88 ms
102,784 KB
testcase_26 AC 64 ms
80,512 KB
testcase_27 AC 55 ms
71,048 KB
testcase_28 AC 54 ms
68,224 KB
testcase_29 AC 70 ms
86,656 KB
testcase_30 AC 60 ms
69,504 KB
testcase_31 AC 78 ms
85,888 KB
testcase_32 AC 117 ms
102,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))

ans=0
r=0
for i in range(N):
    while r<N and A[r]==A[i]+(r-i):
        r+=1
    ans+=r-i-1
print(ans)
0