結果

問題 No.989 N×Mマス計算(K以上)
ユーザー takakin
提出日時 2020-05-09 20:48:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 195 ms / 2,000 ms
コード長 370 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 18,248 KB
最終ジャッジ日時 2024-07-06 04:56:09
合計ジャッジ時間 3,111 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n,m,k=map(int,input().split())
B=[str(i) for i in input().split()]
op=B[0]
B=[int(B[i]) for i in range(1,m+1)]
A=[int(input()) for _ in range(n)]
import bisect
A.sort()
ans=0
if op=="+":
  for b in B:
    ans+=n-bisect.bisect_left(A,k-b)
else:
  for b in B:
    ans+=n-bisect.bisect_left(A,(k-1)//b+1)
print(ans)
  
0