結果

問題 No.2374 ASKT Subsequences
ユーザー rlangevinrlangevin
提出日時 2023-07-07 22:07:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 996 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 77,520 KB
最終ジャッジ日時 2023-09-28 23:25:55
合計ジャッジ時間 5,427 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
70,992 KB
testcase_01 AC 72 ms
71,352 KB
testcase_02 AC 74 ms
71,428 KB
testcase_03 AC 72 ms
71,428 KB
testcase_04 AC 73 ms
71,260 KB
testcase_05 AC 73 ms
71,404 KB
testcase_06 AC 72 ms
71,156 KB
testcase_07 AC 74 ms
71,236 KB
testcase_08 AC 75 ms
71,216 KB
testcase_09 AC 73 ms
71,420 KB
testcase_10 AC 81 ms
75,924 KB
testcase_11 AC 88 ms
76,344 KB
testcase_12 AC 87 ms
76,040 KB
testcase_13 AC 80 ms
75,728 KB
testcase_14 AC 88 ms
76,556 KB
testcase_15 AC 90 ms
76,552 KB
testcase_16 AC 86 ms
76,612 KB
testcase_17 AC 96 ms
77,112 KB
testcase_18 AC 101 ms
76,952 KB
testcase_19 AC 100 ms
77,100 KB
testcase_20 AC 113 ms
77,408 KB
testcase_21 AC 112 ms
77,304 KB
testcase_22 AC 109 ms
77,244 KB
testcase_23 AC 99 ms
77,056 KB
testcase_24 AC 102 ms
76,984 KB
testcase_25 AC 102 ms
77,176 KB
testcase_26 AC 131 ms
77,520 KB
testcase_27 AC 125 ms
77,324 KB
testcase_28 AC 131 ms
77,236 KB
testcase_29 AC 110 ms
77,104 KB
testcase_30 AC 128 ms
77,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

M = 2005        
ans = 0
for i in range(N):
    D = [0] * M
    for j in range(i + 1, N):
        if A[j] >= A[i] + 2:
            D[A[j]] += 1
    now = 0
    for j in range(i - 1, -1, -1):
        if A[j] == A[i] - 10:
            ans += now
        now += D[A[j] + 1]
        
print(ans)
0