結果
問題 | No.989 N×Mマス計算(K以上) |
ユーザー |
|
提出日時 | 2020-12-25 09:53:39 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 158 ms / 2,000 ms |
コード長 | 549 bytes |
コンパイル時間 | 357 ms |
コンパイル使用メモリ | 82,404 KB |
実行使用メモリ | 89,984 KB |
最終ジャッジ日時 | 2024-09-22 02:41:45 |
合計ジャッジ時間 | 3,095 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
from bisect import bisect_left N,M,K = map(int,input().split()) B = list(input().split()) op = B.pop(0) B = sorted(list(map(int,B))) A = sorted([int(input()) for _ in range(N)]) if op=="+": cnt = 0 for i in range(N): a = A[i] if a>=K: cnt += M else: ind = bisect_left(B,K-a) cnt += M-ind else: cnt = 0 for i in range(N): a = A[i] if a>=K: cnt += M else: ind = bisect_left(B,K//a+bool(K%a)) cnt += M-ind print(cnt)