結果
| 問題 | No.2374 ASKT Subsequences |
| コンテスト | |
| ユーザー |
PNJ
|
| 提出日時 | 2023-07-07 22:54:11 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 380 bytes |
| 記録 | |
| コンパイル時間 | 311 ms |
| コンパイル使用メモリ | 21,540 KB |
| 実行使用メモリ | 15,900 KB |
| 最終ジャッジ日時 | 2026-08-22 08:11:56 |
| 合計ジャッジ時間 | 18,295 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 21 |
ソースコード
from collections import defaultdict
N = int(input())
A = list(map(int,input().split()))
X = defaultdict(int)
ans = 0
for i in range(1,N-2):
X[A[i-1]] += 1
Y = defaultdict(int)
for j in range(i+1,N-1):
l = N - 2 - j + i + 1
Y[A[l+1]] += 1
b = A[i]
c = A[l]
k = b - c
a = b - k - 10
d = c + k + 1
p = X[a]
q = Y[d]
ans += p*q
print(ans)
PNJ