結果

問題 No.989 N×Mマス計算(K以上)
ユーザー OhnumaOhnuma
提出日時 2020-04-07 15:22:48
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 322 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,876 KB
実行使用メモリ 17,380 KB
最終ジャッジ日時 2023-09-21 20:18:03
合計ジャッジ時間 4,139 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,976 KB
testcase_01 AC 17 ms
7,908 KB
testcase_02 AC 17 ms
7,932 KB
testcase_03 AC 16 ms
8,028 KB
testcase_04 AC 17 ms
7,872 KB
testcase_05 AC 16 ms
7,956 KB
testcase_06 AC 16 ms
7,928 KB
testcase_07 AC 17 ms
7,940 KB
testcase_08 AC 16 ms
7,968 KB
testcase_09 AC 17 ms
7,912 KB
testcase_10 AC 193 ms
13,408 KB
testcase_11 AC 183 ms
16,020 KB
testcase_12 AC 232 ms
15,300 KB
testcase_13 AC 99 ms
14,048 KB
testcase_14 AC 322 ms
17,380 KB
testcase_15 AC 94 ms
10,404 KB
testcase_16 AC 170 ms
12,028 KB
testcase_17 AC 94 ms
14,040 KB
testcase_18 AC 129 ms
10,344 KB
testcase_19 AC 160 ms
16,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
n,m,k = map(int,input().split())
B = list(input().split())
op = B[0]
B = [int(i) for i in B[1:]]
A = [int(input()) for _ in range(n)]
B.sort()
A.sort()
cnt = 0
if op=='+':
    for b in B:
        dif = k-b
        idx = bisect.bisect_left(A, dif)
        cnt += n-idx
else:
    for b in B:
        dif = k/b
        idx = bisect.bisect_left(A, dif)
        cnt += n-idx
print(cnt)
0