結果

問題 No.2374 ASKT Subsequences
ユーザー ニックネームニックネーム
提出日時 2023-07-07 23:25:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 332 bytes
コンパイル時間 340 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 83,760 KB
最終ジャッジ日時 2023-09-29 01:09:45
合計ジャッジ時間 8,707 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
75,116 KB
testcase_01 AC 80 ms
74,980 KB
testcase_02 AC 79 ms
75,044 KB
testcase_03 AC 78 ms
75,020 KB
testcase_04 AC 79 ms
75,004 KB
testcase_05 WA -
testcase_06 AC 81 ms
74,964 KB
testcase_07 AC 80 ms
74,960 KB
testcase_08 WA -
testcase_09 AC 82 ms
74,960 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 RE -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 189 ms
77,512 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left,bisect_right
n = int(input())
a = list(map(int,input().split()))
b = [[] for _ in range(2001)]
for i,v in enumerate(a): b[v].append(i)
ans = 0
for i in range(n-1):
    for j in range(i+1,n):
        p = a[j]-10; q = a[i]+1
        ans += bisect_left(b[p],i)*(len(b[q])-bisect_right(b[q],j))
print(ans)
0