結果

問題 No.2053 12345...
ユーザー 👑 rin204rin204
提出日時 2022-08-23 14:56:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 112,540 KB
最終ジャッジ日時 2024-04-19 06:05:40
合計ジャッジ時間 4,082 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,840 KB
testcase_01 AC 39 ms
51,968 KB
testcase_02 AC 45 ms
60,160 KB
testcase_03 AC 51 ms
72,976 KB
testcase_04 AC 84 ms
103,680 KB
testcase_05 AC 50 ms
69,248 KB
testcase_06 AC 75 ms
99,072 KB
testcase_07 AC 65 ms
87,168 KB
testcase_08 AC 63 ms
84,608 KB
testcase_09 AC 78 ms
104,360 KB
testcase_10 AC 89 ms
104,448 KB
testcase_11 AC 54 ms
67,968 KB
testcase_12 AC 45 ms
64,384 KB
testcase_13 AC 90 ms
103,936 KB
testcase_14 AC 55 ms
77,184 KB
testcase_15 AC 54 ms
75,392 KB
testcase_16 AC 54 ms
75,264 KB
testcase_17 AC 50 ms
69,120 KB
testcase_18 AC 108 ms
111,972 KB
testcase_19 AC 81 ms
104,192 KB
testcase_20 AC 45 ms
63,872 KB
testcase_21 AC 65 ms
87,168 KB
testcase_22 AC 42 ms
59,264 KB
testcase_23 AC 47 ms
65,408 KB
testcase_24 AC 55 ms
74,880 KB
testcase_25 AC 89 ms
103,808 KB
testcase_26 AC 62 ms
86,400 KB
testcase_27 AC 53 ms
74,496 KB
testcase_28 AC 51 ms
71,728 KB
testcase_29 AC 71 ms
94,720 KB
testcase_30 AC 54 ms
72,704 KB
testcase_31 AC 70 ms
94,080 KB
testcase_32 AC 102 ms
112,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
A = [a - i for i, a in enumerate(A)]
ans = 0
bef = -1
row = 0
for a in A:
    if a == bef:
        row += 1
    else:
        row = 0
        bef = a
    ans += row
print(ans)
0