結果

問題 No.989 N×Mマス計算(K以上)
ユーザー uni_pythonuni_python
提出日時 2020-07-28 22:08:20
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 177 ms / 2,000 ms
コード長 627 bytes
コンパイル時間 971 ms
コンパイル使用メモリ 86,532 KB
実行使用メモリ 91,996 KB
最終ジャッジ日時 2023-09-11 06:49:04
合計ジャッジ時間 4,066 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
70,884 KB
testcase_01 AC 76 ms
70,880 KB
testcase_02 AC 76 ms
70,936 KB
testcase_03 AC 79 ms
71,232 KB
testcase_04 AC 76 ms
71,192 KB
testcase_05 AC 76 ms
70,824 KB
testcase_06 AC 74 ms
70,928 KB
testcase_07 AC 74 ms
71,072 KB
testcase_08 AC 75 ms
71,036 KB
testcase_09 AC 75 ms
70,824 KB
testcase_10 AC 177 ms
85,132 KB
testcase_11 AC 138 ms
89,372 KB
testcase_12 AC 147 ms
87,856 KB
testcase_13 AC 114 ms
86,500 KB
testcase_14 AC 164 ms
91,996 KB
testcase_15 AC 113 ms
78,956 KB
testcase_16 AC 129 ms
82,704 KB
testcase_17 AC 120 ms
86,252 KB
testcase_18 AC 127 ms
78,156 KB
testcase_19 AC 136 ms
89,712 KB
権限があれば一括ダウンロードができます

ソースコード

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