結果

問題 No.989 N×Mマス計算(K以上)
ユーザー 💕💖💞💕💖💞
提出日時 2020-04-10 13:18:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 447 ms / 2,000 ms
コード長 461 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 10,924 KB
実行使用メモリ 40,272 KB
最終ジャッジ日時 2023-10-13 01:33:03
合計ジャッジ時間 6,149 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
29,540 KB
testcase_01 AC 133 ms
29,516 KB
testcase_02 AC 132 ms
29,400 KB
testcase_03 AC 133 ms
29,560 KB
testcase_04 AC 131 ms
29,608 KB
testcase_05 AC 130 ms
29,580 KB
testcase_06 AC 131 ms
29,512 KB
testcase_07 AC 130 ms
29,556 KB
testcase_08 AC 133 ms
29,520 KB
testcase_09 AC 130 ms
29,600 KB
testcase_10 AC 307 ms
35,756 KB
testcase_11 AC 306 ms
37,172 KB
testcase_12 AC 351 ms
37,536 KB
testcase_13 AC 220 ms
34,896 KB
testcase_14 AC 447 ms
40,272 KB
testcase_15 AC 218 ms
31,924 KB
testcase_16 AC 298 ms
34,428 KB
testcase_17 AC 218 ms
35,080 KB
testcase_18 AC 246 ms
31,856 KB
testcase_19 AC 285 ms
37,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
import bisect
n, m, k = map(int, input().split())

x1 = list(input().split())

op = x1.pop(0)

b_arr = list(map(lambda x:int(x), x1))
b_arr.sort()
a_arr = [int(input()) for i in range(n)]
a_arr.sort()

cnt = 0
if op == '+':
    for b in b_arr:
        s = k-b
        idx = bisect.bisect_left(a_arr, s)
        cnt += n -idx
else:
    for b in b_arr:
        s = k/b
        idx = bisect.bisect_left(a_arr, s)
        cnt += n -idx
print(cnt)
0