結果

問題 No.989 N×Mマス計算(K以上)
ユーザー tter4
提出日時 2020-02-15 00:24:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 82,192 KB
実行使用メモリ 92,512 KB
最終ジャッジ日時 2024-10-06 13:33:57
合計ジャッジ時間 2,818 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import math

n, m, k = map(int, input().split())
opb = list(map(str, input().split()))
op = opb[0]
b = [int(x) for x in opb[1:]]
a = [int(input()) for _ in range(n)]

b.sort()

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

print(ans)
0