結果

問題 No.2374 ASKT Subsequences
ユーザー ニックネームニックネーム
提出日時 2023-07-07 23:27:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 353 bytes
コンパイル時間 525 ms
コンパイル使用メモリ 87,180 KB
実行使用メモリ 79,280 KB
最終ジャッジ日時 2023-09-29 01:11:21
合計ジャッジ時間 8,423 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
75,120 KB
testcase_01 AC 80 ms
75,172 KB
testcase_02 AC 78 ms
75,112 KB
testcase_03 AC 80 ms
75,332 KB
testcase_04 AC 81 ms
75,260 KB
testcase_05 WA -
testcase_06 AC 79 ms
75,172 KB
testcase_07 AC 83 ms
75,336 KB
testcase_08 WA -
testcase_09 AC 83 ms
75,264 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 191 ms
77,700 KB
testcase_26 WA -
testcase_27 AC 370 ms
78,412 KB
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
        if 1<=p<=2000>=q>=1: ans += bisect_left(b[p],i)*(len(b[q])-bisect_right(b[q],j))
print(ans)
0