結果

問題 No.989 N×Mマス計算(K以上)
ユーザー toyuzukotoyuzuko
提出日時 2020-03-15 19:08:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 258 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 16,748 KB
最終ジャッジ日時 2023-08-16 18:24:23
合計ジャッジ時間 2,685 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,892 KB
testcase_01 AC 16 ms
7,820 KB
testcase_02 AC 16 ms
7,812 KB
testcase_03 AC 16 ms
7,872 KB
testcase_04 AC 16 ms
7,892 KB
testcase_05 AC 17 ms
7,884 KB
testcase_06 AC 16 ms
7,872 KB
testcase_07 AC 17 ms
7,832 KB
testcase_08 AC 16 ms
7,912 KB
testcase_09 AC 16 ms
7,968 KB
testcase_10 AC 181 ms
13,008 KB
testcase_11 AC 108 ms
15,228 KB
testcase_12 AC 182 ms
14,808 KB
testcase_13 AC 59 ms
13,484 KB
testcase_14 AC 258 ms
16,748 KB
testcase_15 AC 86 ms
10,336 KB
testcase_16 AC 159 ms
12,216 KB
testcase_17 AC 56 ms
13,528 KB
testcase_18 AC 158 ms
10,000 KB
testcase_19 AC 110 ms
15,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left

N, M, K = map(int, input().split())
op, *B = input().split()
B = list(map(int, B))
A = [int(input()) for _ in range(N)]

B.sort()
A.sort()

res = 0

if op == '+':
    for i in range(N):
        res += M - bisect_left(B, K - A[i])
else:
    for i in range(N):
        res += M - bisect_left(B, -(-K // A[i]))

print(res)
0