結果
問題 | No.2374 ASKT Subsequences |
ユーザー | ntuda |
提出日時 | 2023-07-08 01:08:55 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 480 bytes |
コンパイル時間 | 893 ms |
コンパイル使用メモリ | 87,120 KB |
実行使用メモリ | 79,120 KB |
最終ジャッジ日時 | 2023-09-29 02:42:08 |
合計ジャッジ時間 | 10,696 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 93 ms
71,916 KB |
testcase_01 | AC | 97 ms
71,684 KB |
testcase_02 | AC | 100 ms
71,804 KB |
testcase_03 | AC | 93 ms
71,672 KB |
testcase_04 | AC | 93 ms
71,820 KB |
testcase_05 | WA | - |
testcase_06 | AC | 95 ms
71,636 KB |
testcase_07 | AC | 93 ms
71,484 KB |
testcase_08 | WA | - |
testcase_09 | AC | 93 ms
71,704 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 | TLE | - |
testcase_26 | WA | - |
testcase_27 | TLE | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
ソースコード
from bisect import * N = int(input()) A = list(map(int,input().split())) from collections import defaultdict dic = defaultdict(list) for i,a in enumerate(A): dic[a].append(i) ans = 0 for i in range(N - 3): a = A[i] for j in range(i + 1,N - 2): b = A[j] if dic[a+10]: for k in dic[a + 10]: if i < j < k: if dic[b + 1]: ans += len(dic[b + 1]) - bisect_left(dic[b + 1],k) print(ans)