結果
| 問題 |
No.989 N×Mマス計算(K以上)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-02-20 19:45:09 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 261 ms / 2,000 ms |
| コード長 | 442 bytes |
| コンパイル時間 | 276 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 18,256 KB |
| 最終ジャッジ日時 | 2024-10-08 19:09:02 |
| 合計ジャッジ時間 | 2,870 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
from bisect import bisect_left
N, M, K = map(int, input().split())
op, *B = input().split()
B = [int(x) for x in B]
A = [int(input()) for _ in range(N)]
B.sort()
# L = [K - a for a in A] if op == '+' else [(K + a - 1) // a for a in A]
# ans = N * M - sum(bisect_left(B, l) for l in L)
if op == '+':
ans = N * M - sum(bisect_left(B, K - a) for a in A)
else:
ans = N * M - sum(bisect_left(B, (K + a - 1) // a) for a in A)
print(ans)