結果

問題 No.989 N×Mマス計算(K以上)
ユーザー vwxyzvwxyz
提出日時 2023-07-15 04:52:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 10,540 KB
実行使用メモリ 14,628 KB
最終ジャッジ日時 2023-10-14 19:25:30
合計ジャッジ時間 3,554 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,020 KB
testcase_01 AC 15 ms
7,944 KB
testcase_02 AC 15 ms
7,948 KB
testcase_03 AC 15 ms
7,976 KB
testcase_04 AC 15 ms
8,064 KB
testcase_05 AC 15 ms
7,952 KB
testcase_06 AC 14 ms
7,892 KB
testcase_07 AC 14 ms
7,892 KB
testcase_08 AC 15 ms
7,984 KB
testcase_09 AC 15 ms
7,948 KB
testcase_10 AC 104 ms
11,908 KB
testcase_11 AC 92 ms
13,784 KB
testcase_12 AC 113 ms
13,304 KB
testcase_13 AC 58 ms
12,300 KB
testcase_14 AC 160 ms
14,628 KB
testcase_15 AC 55 ms
9,632 KB
testcase_16 AC 91 ms
11,080 KB
testcase_17 AC 58 ms
12,292 KB
testcase_18 AC 73 ms
10,128 KB
testcase_19 AC 90 ms
13,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline
import bisect

N,M,K=map(int,readline().split())
op,*B=readline().split()
for m in range(M):
    B[m]=int(B[m])
A=[int(readline()) for n in range(N)]
B.sort()
ans=0
for a in A:
    if op=="+":
        b=K-a
    else:
        b=(K+a-1)//a
    ans+=M-bisect.bisect_left(B,b)
print(ans)
0