結果

問題 No.3257 +|+
ユーザー nikoro256
提出日時 2025-09-06 03:10:00
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 271 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 82,244 KB
実行使用メモリ 76,892 KB
最終ジャッジ日時 2025-09-06 03:10:07
合計ジャッジ時間 6,283 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 TLE * 1 -- * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N=int(input())
A=list(map(int,input().split()))
ma = sum(A)*2
ans=0
for n in range(1,ma+1):
    dic = defaultdict(int)
    for i in range(min(ma//(n+1)+1,N)):
        d = A[i]-n*(i+1)
        ans+=dic[-d]
        dic[d] += 1
print(ans)
0