結果

問題 No.2374 ASKT Subsequences
ユーザー hibit_athibit_at
提出日時 2023-06-16 22:42:34
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 429 bytes
コンパイル時間 413 ms
コンパイル使用メモリ 87,160 KB
実行使用メモリ 81,864 KB
最終ジャッジ日時 2023-09-12 09:57:10
合計ジャッジ時間 9,869 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
75,684 KB
testcase_01 AC 72 ms
71,292 KB
testcase_02 AC 75 ms
71,512 KB
testcase_03 AC 73 ms
71,480 KB
testcase_04 AC 72 ms
71,148 KB
testcase_05 AC 70 ms
71,408 KB
testcase_06 AC 71 ms
71,304 KB
testcase_07 AC 82 ms
76,448 KB
testcase_08 AC 73 ms
71,388 KB
testcase_09 AC 71 ms
71,536 KB
testcase_10 AC 80 ms
75,940 KB
testcase_11 AC 86 ms
76,768 KB
testcase_12 AC 81 ms
76,252 KB
testcase_13 AC 77 ms
75,924 KB
testcase_14 AC 88 ms
76,640 KB
testcase_15 AC 89 ms
76,732 KB
testcase_16 AC 87 ms
76,700 KB
testcase_17 AC 89 ms
76,500 KB
testcase_18 AC 93 ms
76,356 KB
testcase_19 AC 92 ms
76,636 KB
testcase_20 AC 106 ms
77,416 KB
testcase_21 AC 108 ms
77,456 KB
testcase_22 AC 103 ms
77,428 KB
testcase_23 AC 98 ms
77,188 KB
testcase_24 AC 92 ms
76,604 KB
testcase_25 AC 338 ms
76,716 KB
testcase_26 AC 123 ms
77,364 KB
testcase_27 TLE -
testcase_28 AC 283 ms
76,800 KB
testcase_29 AC 108 ms
77,212 KB
testcase_30 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split(' ')))
m = max(a)
ans = 0
for i in range(n):
    buf = [0] * (m+2)
    for j in range(i, n):
        buf[a[j]] += 1
    for j in range(i, n):
        if a[j] == a[i] + 10:
            for k in range(i+1, j):
                estimate = a[k] - a[i] - 10
                if estimate > 0 and buf[a[k] + 1] > 0:
                    ans += buf[a[k]+1]
        buf[a[j]] -= 1
print(ans)
0