結果

問題 No.989 N×Mマス計算(K以上)
ユーザー ronpooronpoo
提出日時 2023-11-06 13:22:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 81,776 KB
実行使用メモリ 85,948 KB
最終ジャッジ日時 2023-11-06 13:22:18
合計ジャッジ時間 3,718 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,528 KB
testcase_01 AC 39 ms
53,528 KB
testcase_02 AC 39 ms
53,528 KB
testcase_03 AC 39 ms
53,528 KB
testcase_04 AC 39 ms
53,528 KB
testcase_05 AC 39 ms
53,528 KB
testcase_06 AC 38 ms
53,528 KB
testcase_07 AC 39 ms
53,528 KB
testcase_08 AC 40 ms
53,528 KB
testcase_09 AC 39 ms
53,528 KB
testcase_10 AC 132 ms
81,884 KB
testcase_11 AC 121 ms
84,372 KB
testcase_12 AC 130 ms
83,248 KB
testcase_13 AC 99 ms
83,724 KB
testcase_14 AC 153 ms
85,948 KB
testcase_15 AC 98 ms
77,596 KB
testcase_16 AC 111 ms
79,988 KB
testcase_17 AC 101 ms
83,720 KB
testcase_18 AC 109 ms
76,796 KB
testcase_19 AC 122 ms
84,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left

N, M, K = map(int, input().split())
C = list(input().split())
A = [int(input()) for _ in range(N)]
op = C[0]
B = [int(C[i]) for i in range(1, M+1)]
B.append(float('inf'))
B.sort()

ans = 0
for i in range(N):
    if op == '+':
        x = max(0, K-A[i])
    else:
        x = (K+A[i]-1) // A[i]
    ans += M - bisect_left(B, x)
print(ans)
0