結果

問題 No.989 N×Mマス計算(K以上)
ユーザー uni_python
提出日時 2020-07-28 22:08:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 627 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 82,540 KB
実行使用メモリ 91,392 KB
最終ジャッジ日時 2024-06-28 21:00:16
合計ジャッジ時間 2,441 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,M,K=MI()
    Bo=input().split()
    op=Bo[0]
    B=list(map(int, Bo[1:]))
    A=[0]*N
    for i in range(N):
        A[i]=I()
        
    A.sort()
    B.sort()
    
    import bisect
    
    ans=0
    for i in range(N):
        a=A[i]
        if op=="+":
            target=K-a
        else:
            target=K/a
            
        num=bisect.bisect_left(B,target)
        ans+=M-num
        
    print(ans)
            


main()
0