結果

問題 No.989 N×Mマス計算(K以上)
ユーザー brthyyjpbrthyyjp
提出日時 2020-02-14 21:43:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 524 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 92,416 KB
最終ジャッジ日時 2024-04-16 01:42:12
合計ジャッジ時間 2,765 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,096 KB
testcase_01 AC 42 ms
52,480 KB
testcase_02 AC 43 ms
52,224 KB
testcase_03 AC 43 ms
52,608 KB
testcase_04 AC 42 ms
52,096 KB
testcase_05 AC 42 ms
52,992 KB
testcase_06 AC 42 ms
52,480 KB
testcase_07 AC 42 ms
52,608 KB
testcase_08 AC 45 ms
52,352 KB
testcase_09 AC 43 ms
52,992 KB
testcase_10 AC 156 ms
85,248 KB
testcase_11 AC 142 ms
89,728 KB
testcase_12 AC 156 ms
88,192 KB
testcase_13 AC 111 ms
86,272 KB
testcase_14 AC 180 ms
92,416 KB
testcase_15 AC 114 ms
78,592 KB
testcase_16 AC 130 ms
82,432 KB
testcase_17 AC 111 ms
86,400 KB
testcase_18 AC 137 ms
77,824 KB
testcase_19 AC 141 ms
89,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())
l = list(map(str, input().split()))
b = [int(l[i]) for i in range(1, m+1)]

op = l[0]
#print(op)
#rint(b)

a = [0]*n
for i in range(n):
    a[i] = int(input())

#print(a)
#print(b)
a.sort()
b.sort()
import bisect
import math
if op == '+':
    ans = 0
    for i in range(n):
        p = k -a[i]
        q = bisect.bisect_left(b, p)
        ans += m-q
else:
    ans = 0
    for i in range(n):
        p = math.ceil(k/a[i])
        q = bisect.bisect_left(b, p)
        ans += m-q
print(ans)
0