結果

問題 No.2374 ASKT Subsequences
ユーザー とろちゃとろちゃ
提出日時 2023-07-07 22:23:38
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 1,180 bytes
コンパイル時間 347 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 113,532 KB
最終ジャッジ日時 2023-09-28 23:49:14
合計ジャッジ時間 15,109 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
76,080 KB
testcase_01 AC 80 ms
75,864 KB
testcase_02 AC 79 ms
75,744 KB
testcase_03 AC 84 ms
75,584 KB
testcase_04 AC 79 ms
75,780 KB
testcase_05 AC 81 ms
75,648 KB
testcase_06 AC 78 ms
75,580 KB
testcase_07 AC 83 ms
76,164 KB
testcase_08 AC 80 ms
75,592 KB
testcase_09 AC 82 ms
75,940 KB
testcase_10 AC 89 ms
75,976 KB
testcase_11 AC 116 ms
81,032 KB
testcase_12 AC 100 ms
76,336 KB
testcase_13 AC 89 ms
75,952 KB
testcase_14 AC 123 ms
82,948 KB
testcase_15 AC 152 ms
84,328 KB
testcase_16 AC 106 ms
76,216 KB
testcase_17 AC 189 ms
87,016 KB
testcase_18 AC 462 ms
92,076 KB
testcase_19 AC 383 ms
91,004 KB
testcase_20 RE -
testcase_21 WA -
testcase_22 AC 580 ms
96,008 KB
testcase_23 AC 469 ms
92,380 KB
testcase_24 AC 470 ms
92,644 KB
testcase_25 AC 563 ms
92,160 KB
testcase_26 RE -
testcase_27 TLE -
testcase_28 AC 1,283 ms
108,864 KB
testcase_29 TLE -
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 = [[0] * 2001 for _ in range(N)]

for i in range(-1, -N - 1, -1):
    for j in range(2000):
        countList[i][j] = countList[i + 1][j]
    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