結果
| 問題 | No.3257 +|+ |
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2025-09-06 03:14:07 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 597 ms / 3,000 ms |
| + 451µs | |
| コード長 | 269 bytes |
| 記録 | |
| コンパイル時間 | 78 ms |
| コンパイル使用メモリ | 64,212 KB |
| 実行使用メモリ | 118,772 KB |
| 最終ジャッジ日時 | 2026-11-16 11:00:35 |
| 合計ジャッジ時間 | 18,347 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 |
ソースコード
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,N)):
d = A[i]-n*(i+1)
ans+=dic[-d]
dic[d] += 1
print(ans)
nikoro256