結果

問題 No.989 N×Mマス計算(K以上)
ユーザー stng
提出日時 2022-08-17 11:03:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 82,168 KB
実行使用メモリ 90,912 KB
最終ジャッジ日時 2024-10-04 10:43:37
合計ジャッジ時間 2,656 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
n,m,k = map(int,input().split())
opb = input().split()
op = opb[0]
b = []
for i in range(1,m+1):
    b.append(int(opb[i]))

a = [int(input()) for i in range(n)]
a.sort()
b.sort()

ans = 0

for i in range(n):
    if op == "+":
        ans += m-bisect.bisect_left(b,k-a[i])
    else:
        ans += m-bisect.bisect_left(b,(k+a[i]-1)//a[i])
    #print(n,ans)

print(ans)
0