結果

問題 No.989 N×Mマス計算(K以上)
ユーザー tktk_snsntktk_snsn
提出日時 2020-12-12 23:06:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 441 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 11,936 KB
実行使用メモリ 18,756 KB
最終ジャッジ日時 2023-10-20 02:45:21
合計ジャッジ時間 2,177 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,160 KB
testcase_01 AC 29 ms
10,160 KB
testcase_02 AC 29 ms
10,228 KB
testcase_03 AC 28 ms
10,228 KB
testcase_04 AC 28 ms
10,164 KB
testcase_05 AC 28 ms
10,160 KB
testcase_06 AC 27 ms
10,164 KB
testcase_07 AC 29 ms
10,164 KB
testcase_08 AC 29 ms
10,224 KB
testcase_09 AC 28 ms
10,164 KB
testcase_10 AC 106 ms
14,924 KB
testcase_11 AC 90 ms
17,328 KB
testcase_12 AC 115 ms
16,500 KB
testcase_13 AC 62 ms
15,528 KB
testcase_14 AC 157 ms
18,756 KB
testcase_15 AC 64 ms
12,144 KB
testcase_16 AC 96 ms
14,484 KB
testcase_17 AC 63 ms
15,524 KB
testcase_18 AC 82 ms
12,072 KB
testcase_19 AC 93 ms
17,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
from operator import add, mul
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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()

ans = 0
if op == "+":
    for a in A:
        ans += m - bisect.bisect_left(B, k - a)
    print(ans)
else:
    for a in A:
        ans += m - bisect.bisect_left(B, (k + a - 1) // a)
    print(ans)
0