結果

問題 No.2374 ASKT Subsequences
ユーザー とろちゃとろちゃ
提出日時 2023-07-07 22:12:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,147 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 86,848 KB
実行使用メモリ 185,928 KB
最終ジャッジ日時 2023-09-28 23:32:56
合計ジャッジ時間 12,197 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
185,928 KB
testcase_01 AC 100 ms
71,748 KB
testcase_02 AC 96 ms
71,744 KB
testcase_03 AC 96 ms
71,824 KB
testcase_04 AC 95 ms
71,696 KB
testcase_05 AC 94 ms
71,692 KB
testcase_06 AC 94 ms
71,508 KB
testcase_07 AC 105 ms
77,296 KB
testcase_08 AC 101 ms
76,816 KB
testcase_09 AC 103 ms
77,360 KB
testcase_10 AC 110 ms
77,444 KB
testcase_11 AC 127 ms
77,744 KB
testcase_12 WA -
testcase_13 AC 111 ms
77,772 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 191 ms
77,416 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 1,039 ms
77,720 KB
testcase_26 TLE -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# 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)
0