結果
| 問題 |
No.2374 ASKT Subsequences
|
| コンテスト | |
| ユーザー |
とろちゃ
|
| 提出日時 | 2023-07-07 22:12:40 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,147 bytes |
| コンパイル時間 | 575 ms |
| コンパイル使用メモリ | 81,996 KB |
| 実行使用メモリ | 117,504 KB |
| 最終ジャッジ日時 | 2024-07-21 18:16:27 |
| 合計ジャッジ時間 | 11,089 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 WA * 11 TLE * 2 -- * 3 |
ソースコード
# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1")
# from bisect import *
from collections import *
# from heapq import *
# from itertools import *
# from math import *
# from datetime import *
# from decimal import * # PyPyだと遅い
# from string import ascii_lowercase,ascii_uppercase
# import numpy as np
import sys
import os
# sys.setrecursionlimit(10**6) # PyPyだと遅い
INF = 10**18
MOD = 998244353
# MOD = 10**9 + 7
isFile = os.path.exists("input.txt")
File = open("input.txt", "r", encoding="utf-8") if isFile else sys.stdin
def input():
return File.readline()[:-1]
# ///////////////////////////////////////////////////////////////////////////
N = int(input())
A = list(map(int, input().split()))
countList = [Counter() for _ in range(N)]
for i in range(-1, -N - 1, -1):
countList[i].update(countList[i + 1])
countList[i][A[i]] += 1
ans = 0
for i in range(N):
for j in range(i + 1, N):
diff = A[j] - A[i] - 10
if diff < 0:
continue
for k in range(j + 1, N):
if A[k] == A[j] - diff:
ans += countList[k][A[k] + diff + 1]
print(ans)
とろちゃ