結果

問題 No.2053 12345...
ユーザー ecotteaecottea
提出日時 2024-02-26 22:37:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 215 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 31,856 KB
最終ジャッジ日時 2024-02-26 22:37:50
合計ジャッジ時間 4,967 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
9,856 KB
testcase_01 AC 25 ms
9,856 KB
testcase_02 AC 30 ms
10,240 KB
testcase_03 AC 48 ms
14,796 KB
testcase_04 AC 94 ms
24,692 KB
testcase_05 AC 47 ms
13,036 KB
testcase_06 AC 82 ms
23,280 KB
testcase_07 AC 68 ms
19,352 KB
testcase_08 AC 65 ms
18,380 KB
testcase_09 AC 93 ms
24,760 KB
testcase_10 AC 117 ms
30,576 KB
testcase_11 AC 39 ms
12,852 KB
testcase_12 AC 34 ms
11,904 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 50 ms
15,612 KB
testcase_18 WA -
testcase_19 AC 100 ms
25,472 KB
testcase_20 AC 35 ms
11,648 KB
testcase_21 WA -
testcase_22 AC 26 ms
9,984 KB
testcase_23 AC 36 ms
12,160 KB
testcase_24 AC 60 ms
15,408 KB
testcase_25 AC 119 ms
29,596 KB
testcase_26 AC 68 ms
19,208 KB
testcase_27 AC 52 ms
15,412 KB
testcase_28 AC 47 ms
14,164 KB
testcase_29 AC 86 ms
22,604 KB
testcase_30 AC 45 ms
14,672 KB
testcase_31 AC 82 ms
21,940 KB
testcase_32 AC 127 ms
31,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

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

for i in range(n):
    a[i] -= i

hist = Counter(a)

res = 0

for x, c in hist.items():
    res += c * (c - 1) // 2

print(res)
0