結果
| 問題 |
No.989 N×Mマス計算(K以上)
|
| コンテスト | |
| ユーザー |
oshii
|
| 提出日時 | 2020-03-20 19:14:14 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 430 bytes |
| コンパイル時間 | 272 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 20,480 KB |
| 最終ジャッジ日時 | 2024-12-14 14:43:03 |
| 合計ジャッジ時間 | 6,815 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 TLE * 1 |
ソースコード
import bisect import math n, m, k = map(int, input().split()) bw = list(map(str, input().split())) a = [int(input()) for i in range(n)] a.sort() op = bw.pop(0) b = [int(i) for i in bw] b.sort() ans = 0 if op == "+": c = bisect.bisect_left(b,k) ans += len(b[c:])*len(a) for i in b[:c]: d = bisect.bisect_left(a,k-i) ans += len(a[d:]) else: for i in range(n): ans += m - bisect.bisect_left(b,math.ceil(k/a[i])) print (ans)
oshii