結果

問題 No.2374 ASKT Subsequences
ユーザー Ekiben542Ekiben542
提出日時 2023-07-07 22:07:16
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 529 bytes
コンパイル時間 414 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 81,192 KB
最終ジャッジ日時 2023-09-28 23:25:19
合計ジャッジ時間 9,417 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
75,676 KB
testcase_01 AC 69 ms
71,432 KB
testcase_02 AC 77 ms
71,476 KB
testcase_03 AC 70 ms
71,160 KB
testcase_04 AC 69 ms
71,360 KB
testcase_05 AC 69 ms
71,656 KB
testcase_06 AC 69 ms
71,492 KB
testcase_07 AC 73 ms
75,712 KB
testcase_08 AC 73 ms
75,444 KB
testcase_09 AC 75 ms
75,632 KB
testcase_10 AC 78 ms
76,224 KB
testcase_11 AC 87 ms
76,148 KB
testcase_12 AC 83 ms
76,112 KB
testcase_13 AC 81 ms
76,304 KB
testcase_14 AC 95 ms
76,448 KB
testcase_15 AC 114 ms
76,236 KB
testcase_16 AC 87 ms
76,264 KB
testcase_17 AC 140 ms
76,672 KB
testcase_18 AC 299 ms
76,664 KB
testcase_19 AC 242 ms
76,740 KB
testcase_20 AC 563 ms
77,032 KB
testcase_21 AC 796 ms
76,900 KB
testcase_22 AC 438 ms
77,040 KB
testcase_23 AC 310 ms
76,652 KB
testcase_24 AC 311 ms
76,456 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