結果

問題 No.989 N×Mマス計算(K以上)
ユーザー FromBooskaFromBooska
提出日時 2023-03-01 21:07:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 176 ms / 2,000 ms
コード長 514 bytes
コンパイル時間 1,183 ms
コンパイル使用メモリ 86,572 KB
実行使用メモリ 93,484 KB
最終ジャッジ日時 2023-10-15 00:42:29
合計ジャッジ時間 4,059 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,144 KB
testcase_01 AC 71 ms
71,224 KB
testcase_02 AC 70 ms
70,832 KB
testcase_03 AC 71 ms
71,032 KB
testcase_04 AC 70 ms
71,060 KB
testcase_05 AC 71 ms
71,032 KB
testcase_06 AC 69 ms
71,216 KB
testcase_07 AC 71 ms
70,848 KB
testcase_08 AC 70 ms
71,040 KB
testcase_09 AC 70 ms
70,856 KB
testcase_10 AC 154 ms
86,308 KB
testcase_11 AC 149 ms
91,232 KB
testcase_12 AC 154 ms
88,916 KB
testcase_13 AC 125 ms
87,748 KB
testcase_14 AC 176 ms
93,484 KB
testcase_15 AC 124 ms
79,900 KB
testcase_16 AC 134 ms
83,920 KB
testcase_17 AC 125 ms
87,688 KB
testcase_18 AC 132 ms
77,524 KB
testcase_19 AC 147 ms
90,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# ARC037C - 億マス計算に近いけどそれよりも簡単
# B昇順ソートして、bisectで何個満たすか数えればいい

N, M, K = map(int, input().split())
op_B = list(map(str, input().split()))
op = op_B[0]
B = [int(b) for b in op_B[1:]]
B.sort()

count = 0
from bisect import *
for i in range(N):
    a = int(input())
    if op == '+':
        idx = bisect_left(B, K-a)
        count += M - idx
    elif op == '*':
        idx = bisect_left(B, K/a)
        count += M - idx        
print(count)
0