結果
問題 |
No.989 N×Mマス計算(K以上)
|
ユーザー |
![]() |
提出日時 | 2020-02-14 23:28:40 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 274 ms / 2,000 ms |
コード長 | 493 bytes |
コンパイル時間 | 306 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 20,452 KB |
最終ジャッジ日時 | 2024-10-06 13:25:13 |
合計ジャッジ時間 | 2,857 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
from sys import stdin import bisect n,m,k = map(int,stdin.readline().rstrip().split()) li = list(map(str,stdin.readline().rstrip().split())) op = li[0] b = [int(li[i]) for i in range(1,m+1)] a = [int(stdin.readline().rstrip()) for _ in range(n)] a.sort();b.sort() point = 0 now = 0 for i in range(n): if op == "+": A = k-a[i] B = bisect.bisect_left(b,A) point += m-B else: A = k/a[i] B = bisect.bisect_left(b,A) point += m-B print(point)