結果

問題 No.989 N×Mマス計算(K以上)
ユーザー O2MTO2MT
提出日時 2020-08-20 00:38:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 423 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 22,132 KB
最終ジャッジ日時 2024-04-20 15:18:02
合計ジャッジ時間 2,850 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,880 KB
testcase_01 AC 27 ms
11,008 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 30 ms
10,880 KB
testcase_04 AC 28 ms
10,752 KB
testcase_05 AC 27 ms
11,008 KB
testcase_06 WA -
testcase_07 AC 26 ms
10,880 KB
testcase_08 WA -
testcase_09 AC 28 ms
10,880 KB
testcase_10 AC 221 ms
17,704 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 90 ms
16,208 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 192 ms
16,128 KB
testcase_17 AC 85 ms
16,324 KB
testcase_18 AC 180 ms
13,696 KB
testcase_19 AC 151 ms
19,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import *
from math import floor
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,floor(K/A[i]))
    ans += (M-b)

print(ans)
0