結果
問題 |
No.3257 +|+
|
ユーザー |
![]() |
提出日時 | 2025-09-06 03:12:16 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 271 bytes |
コンパイル時間 | 356 ms |
コンパイル使用メモリ | 82,488 KB |
実行使用メモリ | 262,728 KB |
最終ジャッジ日時 | 2025-09-06 03:12:49 |
合計ジャッジ時間 | 28,203 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 22 |
ソースコード
from collections import defaultdict N=int(input()) A=list(map(int,input().split())) ma = max(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)