結果

問題 No.989 N×Mマス計算(K以上)
ユーザー roarisroaris
提出日時 2020-03-13 18:15:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 1,404 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 91,504 KB
最終ジャッジ日時 2023-08-14 14:10:11
合計ジャッジ時間 4,614 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,316 KB
testcase_01 AC 72 ms
71,100 KB
testcase_02 AC 73 ms
71,156 KB
testcase_03 AC 70 ms
71,008 KB
testcase_04 AC 73 ms
71,340 KB
testcase_05 AC 71 ms
71,344 KB
testcase_06 AC 71 ms
71,320 KB
testcase_07 AC 72 ms
71,232 KB
testcase_08 AC 70 ms
70,904 KB
testcase_09 AC 71 ms
70,908 KB
testcase_10 AC 138 ms
85,244 KB
testcase_11 AC 129 ms
89,676 KB
testcase_12 AC 130 ms
87,580 KB
testcase_13 AC 109 ms
86,704 KB
testcase_14 AC 147 ms
91,504 KB
testcase_15 AC 105 ms
79,108 KB
testcase_16 AC 113 ms
82,192 KB
testcase_17 AC 109 ms
86,392 KB
testcase_18 AC 109 ms
77,900 KB
testcase_19 AC 126 ms
89,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from bisect import *

N, M, K = map(int, input().split())
inp = input().split()
op = inp[0]
B = list(map(int, inp[1:]))
A = [int(input()) for _ in range(N)]
B.sort()
ans = 0

for Ai in A:
    if op=='+':
        Ci = K-Ai
    else:
        Ci = (K+Ai-1)//Ai
        
    ans += M-bisect_left(B, Ci)

print(ans)
0