結果

問題 No.989 N×Mマス計算(K以上)
ユーザー oshiioshii
提出日時 2020-03-20 19:14:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 430 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 10,928 KB
実行使用メモリ 18,920 KB
最終ジャッジ日時 2023-08-21 05:39:27
合計ジャッジ時間 6,324 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,088 KB
testcase_01 AC 16 ms
7,952 KB
testcase_02 AC 17 ms
7,952 KB
testcase_03 AC 16 ms
8,096 KB
testcase_04 AC 17 ms
7,904 KB
testcase_05 AC 17 ms
7,936 KB
testcase_06 AC 16 ms
7,972 KB
testcase_07 AC 16 ms
7,884 KB
testcase_08 AC 17 ms
7,960 KB
testcase_09 AC 17 ms
7,928 KB
testcase_10 TLE -
testcase_11 AC 117 ms
16,132 KB
testcase_12 AC 195 ms
16,268 KB
testcase_13 AC 63 ms
13,900 KB
testcase_14 AC 275 ms
18,920 KB
testcase_15 AC 92 ms
10,864 KB
testcase_16 AC 168 ms
13,188 KB
testcase_17 AC 180 ms
13,884 KB
testcase_18 AC 380 ms
10,824 KB
testcase_19 AC 1,447 ms
16,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import math
n, m, k = map(int, input().split())
bw = list(map(str, input().split()))
a = [int(input()) for i in range(n)]
a.sort()
op = bw.pop(0)
b = [int(i) for i in bw]
b.sort()
ans = 0
if op == "+":
	c = bisect.bisect_left(b,k)
	ans += len(b[c:])*len(a)
	for i in b[:c]:
		d = bisect.bisect_left(a,k-i)
		ans += len(a[d:])
else:
	for i in range(n):
		ans += m - bisect.bisect_left(b,math.ceil(k/a[i]))
print (ans)
0