結果

問題 No.2374 ASKT Subsequences
ユーザー ニックネームニックネーム
提出日時 2023-07-07 22:32:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 366 bytes
コンパイル時間 819 ms
コンパイル使用メモリ 10,812 KB
実行使用メモリ 12,608 KB
最終ジャッジ日時 2023-09-29 00:00:33
合計ジャッジ時間 11,070 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,196 KB
testcase_01 AC 18 ms
7,888 KB
testcase_02 AC 17 ms
7,736 KB
testcase_03 AC 25 ms
7,836 KB
testcase_04 AC 26 ms
7,780 KB
testcase_05 AC 28 ms
7,948 KB
testcase_06 AC 24 ms
7,760 KB
testcase_07 AC 240 ms
7,788 KB
testcase_08 AC 263 ms
7,760 KB
testcase_09 AC 272 ms
7,788 KB
testcase_10 AC 1,052 ms
7,840 KB
testcase_11 AC 424 ms
7,976 KB
testcase_12 AC 292 ms
7,812 KB
testcase_13 AC 283 ms
7,836 KB
testcase_14 AC 831 ms
7,816 KB
testcase_15 AC 1,659 ms
7,744 KB
testcase_16 AC 554 ms
7,812 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int,input().split()))
s = set(a); m = max(a); ans = 0
for k in range(1,m):
    for t in range(1,m):
        p = [t,t+k+10,t+10,t+k+11]; f = True
        for v in p: f &= v in s
        if not f: continue
        dp = [1,0,0,0,0]
        for v in a:
            if v in p: i = p.index(v); dp[i+1] += dp[i]
        ans += dp[4]
print(ans)
0