結果

問題 No.989 N×Mマス計算(K以上)
ユーザー syunsuke
提出日時 2020-09-16 19:36:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 446 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,312 KB
実行使用メモリ 87,352 KB
最終ジャッジ日時 2024-06-22 03:28:40
合計ジャッジ時間 2,492 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W,K=map(int,input().split())

B=list(input().split())
OP=B[0]
B=B[1:]
#print(B)
for i in range(len(B)):
    B[i]=int(B[i])
B.sort()
B=B+[10**10]
#print(B)

import bisect

ans=0
if OP=="+":
    for i in range(H):
        A=int(input())
        x=bisect.bisect_left(B,K-0.1-A)
        ans+=(W-x)
    print(ans)
else:
    for i in range(H):
        A=int(input())
        x=bisect.bisect_left(B,K/A)
        ans+=(W-x)
    print(ans)
        
    
0