結果
問題 | No.2374 ASKT Subsequences |
ユーザー | とろちゃ |
提出日時 | 2023-07-07 22:16:46 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,148 bytes |
コンパイル時間 | 1,618 ms |
コンパイル使用メモリ | 86,904 KB |
実行使用メモリ | 118,560 KB |
最終ジャッジ日時 | 2023-09-28 23:39:02 |
合計ジャッジ時間 | 11,534 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 90 ms
76,072 KB |
testcase_01 | AC | 89 ms
71,424 KB |
testcase_02 | AC | 97 ms
71,312 KB |
testcase_03 | AC | 94 ms
71,420 KB |
testcase_04 | AC | 91 ms
71,504 KB |
testcase_05 | AC | 89 ms
71,696 KB |
testcase_06 | AC | 93 ms
71,312 KB |
testcase_07 | AC | 100 ms
77,180 KB |
testcase_08 | AC | 96 ms
76,552 KB |
testcase_09 | AC | 101 ms
76,412 KB |
testcase_10 | AC | 106 ms
77,448 KB |
testcase_11 | AC | 121 ms
77,728 KB |
testcase_12 | AC | 118 ms
77,668 KB |
testcase_13 | AC | 107 ms
77,480 KB |
testcase_14 | AC | 133 ms
77,468 KB |
testcase_15 | AC | 153 ms
77,508 KB |
testcase_16 | AC | 120 ms
77,608 KB |
testcase_17 | AC | 189 ms
77,532 KB |
testcase_18 | AC | 442 ms
85,716 KB |
testcase_19 | AC | 371 ms
84,612 KB |
testcase_20 | AC | 756 ms
96,000 KB |
testcase_21 | AC | 1,134 ms
100,732 KB |
testcase_22 | AC | 649 ms
92,892 KB |
testcase_23 | AC | 443 ms
85,880 KB |
testcase_24 | AC | 453 ms
85,780 KB |
testcase_25 | AC | 701 ms
77,460 KB |
testcase_26 | TLE | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
ソースコード
# 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)