結果

問題 No.989 N×Mマス計算(K以上)
ユーザー c-yanc-yan
提出日時 2020-03-22 00:54:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 254 ms / 2,000 ms
コード長 339 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 10,540 KB
実行使用メモリ 18,848 KB
最終ジャッジ日時 2023-08-25 18:36:39
合計ジャッジ時間 3,171 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
8,028 KB
testcase_01 AC 14 ms
7,880 KB
testcase_02 AC 14 ms
7,932 KB
testcase_03 AC 15 ms
7,896 KB
testcase_04 AC 15 ms
7,916 KB
testcase_05 AC 16 ms
7,952 KB
testcase_06 AC 16 ms
7,984 KB
testcase_07 AC 15 ms
8,048 KB
testcase_08 AC 14 ms
8,000 KB
testcase_09 AC 15 ms
7,912 KB
testcase_10 AC 151 ms
14,468 KB
testcase_11 AC 102 ms
15,872 KB
testcase_12 AC 178 ms
16,304 KB
testcase_13 AC 55 ms
13,216 KB
testcase_14 AC 254 ms
18,848 KB
testcase_15 AC 80 ms
10,840 KB
testcase_16 AC 151 ms
12,868 KB
testcase_17 AC 51 ms
13,340 KB
testcase_18 AC 130 ms
10,552 KB
testcase_19 AC 100 ms
16,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left

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

B = list(map(int, B))

B.sort()

result = 0
if op == '+':
    for a in A:
        result += M - bisect_left(B, K - a)
elif op == '*':
    for a in A:
        result += M - bisect_left(B, K / a)
print(result)
0