結果
問題 | No.2374 ASKT Subsequences |
ユーザー | 👑 rin204 |
提出日時 | 2023-07-07 21:33:21 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 356 bytes |
コンパイル時間 | 397 ms |
コンパイル使用メモリ | 87,192 KB |
実行使用メモリ | 159,368 KB |
最終ジャッジ日時 | 2023-09-28 22:32:14 |
合計ジャッジ時間 | 6,451 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 70 ms
71,152 KB |
testcase_01 | AC | 70 ms
71,300 KB |
testcase_02 | AC | 71 ms
71,304 KB |
testcase_03 | AC | 76 ms
71,152 KB |
testcase_04 | AC | 70 ms
71,328 KB |
testcase_05 | WA | - |
testcase_06 | AC | 69 ms
71,244 KB |
testcase_07 | AC | 70 ms
71,380 KB |
testcase_08 | WA | - |
testcase_09 | AC | 70 ms
71,328 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 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | AC | 106 ms
76,448 KB |
testcase_26 | WA | - |
testcase_27 | AC | 164 ms
78,612 KB |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
ソースコード
n = int(input()) A = list(map(int, input().split())) L = [] R = [] l = {} for a in A: L.append(l.copy()) l[a] = l.get(a, 0) + 1 r = {} for a in A[::-1]: R.append(r.copy()) r[a] = r.get(a, 0) + 1 R = R[::-1] ans = 0 for l in range(n): for r in range(l + 1, n): ans += L[l].get(A[r] - 10, 0) * R[r].get(A[l] + 1, 0) print(ans)