結果
問題 |
No.989 N×Mマス計算(K以上)
|
ユーザー |
![]() |
提出日時 | 2020-04-10 13:18:39 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 975 ms / 2,000 ms |
コード長 | 461 bytes |
コンパイル時間 | 262 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 50,216 KB |
最終ジャッジ日時 | 2024-09-14 23:19:16 |
合計ジャッジ時間 | 15,969 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
import numpy as np import bisect n, m, k = map(int, input().split()) x1 = list(input().split()) op = x1.pop(0) b_arr = list(map(lambda x:int(x), x1)) b_arr.sort() a_arr = [int(input()) for i in range(n)] a_arr.sort() cnt = 0 if op == '+': for b in b_arr: s = k-b idx = bisect.bisect_left(a_arr, s) cnt += n -idx else: for b in b_arr: s = k/b idx = bisect.bisect_left(a_arr, s) cnt += n -idx print(cnt)