結果

問題 No.2374 ASKT Subsequences
ユーザー meruuu61779999meruuu61779999
提出日時 2023-07-07 22:09:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 450 bytes
コンパイル時間 1,371 ms
コンパイル使用メモリ 86,936 KB
実行使用メモリ 80,180 KB
最終ジャッジ日時 2023-09-28 23:30:05
合計ジャッジ時間 5,931 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,348 KB
testcase_01 AC 79 ms
71,352 KB
testcase_02 AC 80 ms
71,260 KB
testcase_03 AC 79 ms
71,084 KB
testcase_04 AC 79 ms
71,112 KB
testcase_05 WA -
testcase_06 AC 77 ms
71,244 KB
testcase_07 AC 80 ms
71,300 KB
testcase_08 WA -
testcase_09 AC 80 ms
71,308 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 RE -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 98 ms
76,828 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))

All = [0] * 2001
for a in A:
    All[a] += 1

ans = 0
for i in range(N - 3):
    right = All[:]
    left = [0] * 2001
    right[A[i]] -= 1
    right[A[i + 1]] -= 1
    line = 0
    for j in range(i + 2, N - 1):
        right[A[j]] -= 1
        line -= left[A[j] - 1]
        left[A[j - 1]] += 1
        line += right[A[j - 1] + 1]
        if A[i] + 10 == A[j]:
            ans += line
print(ans)
0