結果

問題 No.989 N×Mマス計算(K以上)
ユーザー lloyzlloyz
提出日時 2022-06-04 14:42:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 286 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 11,848 KB
実行使用メモリ 19,212 KB
最終ジャッジ日時 2023-10-21 02:41:08
合計ジャッジ時間 2,646 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,092 KB
testcase_01 AC 29 ms
10,092 KB
testcase_02 AC 29 ms
10,096 KB
testcase_03 AC 26 ms
10,096 KB
testcase_04 AC 26 ms
10,096 KB
testcase_05 AC 25 ms
10,092 KB
testcase_06 AC 24 ms
10,096 KB
testcase_07 AC 25 ms
10,096 KB
testcase_08 AC 28 ms
10,092 KB
testcase_09 AC 27 ms
10,096 KB
testcase_10 AC 185 ms
15,348 KB
testcase_11 AC 116 ms
17,748 KB
testcase_12 AC 198 ms
17,088 KB
testcase_13 AC 72 ms
15,988 KB
testcase_14 AC 286 ms
19,212 KB
testcase_15 AC 98 ms
12,168 KB
testcase_16 AC 172 ms
14,448 KB
testcase_17 AC 62 ms
15,984 KB
testcase_18 AC 163 ms
12,152 KB
testcase_19 AC 118 ms
18,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_right

n, m, k = map(int, input().split())
B = list(input().split())
op = B[0]
B = list(map(int, B[1:]))
A = [int(input()) for _ in range(n)]

A.sort()
B.sort()
ans = 0
for i in range(n):
    if op == '+':
        res = k - A[i] - 1
    elif op == '*':
        res = k // A[i]
        if k % A[i] == 0:
            res -= 1
    cnt = bisect_right(B, res)
    ans += cnt
print(n * m - ans)
0