結果

問題 No.989 N×Mマス計算(K以上)
ユーザー brthyyjp
提出日時 2020-02-14 21:43:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 524 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 82,720 KB
実行使用メモリ 92,288 KB
最終ジャッジ日時 2024-10-06 11:05:35
合計ジャッジ時間 2,837 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

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