結果
| 問題 |
No.3257 +|+
|
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2025-09-06 03:14:07 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,174 ms / 3,000 ms |
| コード長 | 269 bytes |
| コンパイル時間 | 703 ms |
| コンパイル使用メモリ | 83,036 KB |
| 実行使用メモリ | 261,572 KB |
| 最終ジャッジ日時 | 2025-09-06 03:14:39 |
| 合計ジャッジ時間 | 28,939 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
ソースコード
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