結果

問題 No.2374 ASKT Subsequences
ユーザー ニックネーム
提出日時 2023-07-07 22:32:40
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 366 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 82,204 KB
実行使用メモリ 83,464 KB
最終ジャッジ日時 2024-07-21 18:44:59
合計ジャッジ時間 10,844 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 TLE * 2 -- * 9
権限があれば一括ダウンロードができます

ソースコード

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