結果

問題 No.989 N×Mマス計算(K以上)
ユーザー O2MTO2MT
提出日時 2020-08-20 00:42:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 333 ms / 2,000 ms
コード長 422 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 22,004 KB
最終ジャッジ日時 2024-04-20 15:23:00
合計ジャッジ時間 3,306 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,880 KB
testcase_01 AC 29 ms
10,880 KB
testcase_02 AC 29 ms
10,880 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 30 ms
10,880 KB
testcase_06 AC 30 ms
11,008 KB
testcase_07 AC 31 ms
10,752 KB
testcase_08 AC 30 ms
10,880 KB
testcase_09 AC 29 ms
10,880 KB
testcase_10 AC 232 ms
17,672 KB
testcase_11 AC 156 ms
18,680 KB
testcase_12 AC 240 ms
19,096 KB
testcase_13 AC 98 ms
16,580 KB
testcase_14 AC 333 ms
22,004 KB
testcase_15 AC 120 ms
13,952 KB
testcase_16 AC 208 ms
16,244 KB
testcase_17 AC 92 ms
16,328 KB
testcase_18 AC 192 ms
13,696 KB
testcase_19 AC 163 ms
18,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import *
from math import ceil
N,M,K = map(int,input().split())
l = list(map(str,input().split()))
op = l[0]
B = [0]*M
for i in range(1,M+1):
  B[i-1] = int(l[i])

A = [int(input()) for _ in range(N)]
A,B = sorted(A),sorted(B)
ans = 0

if op == "+":
  for i in range(N):
    b = bisect_left(B,K-A[i])
    ans += (M-b)
else:
  for i in range(N):
    b = bisect_left(B,ceil(K/A[i]))
    ans += (M-b)

print(ans)
0