結果
問題 |
No.989 N×Mマス計算(K以上)
|
ユーザー |
|
提出日時 | 2020-08-20 00:42:36 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 351 ms / 2,000 ms |
コード長 | 422 bytes |
コンパイル時間 | 545 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 22,132 KB |
最終ジャッジ日時 | 2024-10-12 11:02:16 |
合計ジャッジ時間 | 3,335 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
from bisect import * from math import ceil N,M,K = map(int,input().split()) l = list(map(str,input().split())) op = l[0] B = [0]*M for i in range(1,M+1): B[i-1] = int(l[i]) A = [int(input()) for _ in range(N)] A,B = sorted(A),sorted(B) ans = 0 if op == "+": for i in range(N): b = bisect_left(B,K-A[i]) ans += (M-b) else: for i in range(N): b = bisect_left(B,ceil(K/A[i])) ans += (M-b) print(ans)