結果

問題 No.2374 ASKT Subsequences
ユーザー 2000 Ekiben2000 Ekiben
提出日時 2023-07-07 22:07:16
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 529 bytes
コンパイル時間 530 ms
コンパイル使用メモリ 82,544 KB
実行使用メモリ 82,696 KB
最終ジャッジ日時 2024-07-21 18:09:38
合計ジャッジ時間 8,056 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
56,960 KB
testcase_01 AC 36 ms
51,968 KB
testcase_02 AC 37 ms
51,968 KB
testcase_03 AC 38 ms
52,224 KB
testcase_04 AC 36 ms
51,968 KB
testcase_05 AC 36 ms
51,712 KB
testcase_06 AC 36 ms
51,968 KB
testcase_07 AC 41 ms
58,368 KB
testcase_08 AC 40 ms
57,216 KB
testcase_09 AC 41 ms
58,240 KB
testcase_10 AC 46 ms
61,184 KB
testcase_11 AC 54 ms
64,384 KB
testcase_12 AC 51 ms
63,104 KB
testcase_13 AC 49 ms
62,336 KB
testcase_14 AC 65 ms
66,688 KB
testcase_15 AC 82 ms
70,784 KB
testcase_16 AC 57 ms
65,280 KB
testcase_17 AC 111 ms
75,264 KB
testcase_18 AC 270 ms
75,136 KB
testcase_19 AC 213 ms
75,648 KB
testcase_20 AC 534 ms
76,032 KB
testcase_21 AC 768 ms
76,072 KB
testcase_22 AC 405 ms
75,904 KB
testcase_23 AC 284 ms
75,392 KB
testcase_24 AC 282 ms
76,032 KB
testcase_25 TLE -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def count_asakatsu_subsequences(N, A):
    cnt = 0
    for i in range(N - 3):
        for j in range(i + 1, N - 2):
            k = A[j] - A[i] - 10
            if k > 0:
                for m in range(j + 1, N - 1):
                    if A[m] == A[j] - k:
                        for n in range(m + 1, N):
                            if A[n] == A[m] + k + 1:
                                cnt += 1
    return cnt

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

result = count_asakatsu_subsequences(N, A)

print(result)
0