为什么python会RE?

P1080 [NOIP2012 提高组] 国王游戏

~~坚持手写高精,抵制py,从我做起~~
by FrenzyHydra @ 2018-05-31 21:58:07


```python n = int(input()) x, y = map(int, input().split()) w = [] for i in range(0, n): L, R = map(int, input().split()) w.append({"L": L, "R": R, "val": L*R}) w.sort(key=lambda num: num["val"]) cnt = x ans = 0 for i in range(0, n): ans = max(ans, cnt//w[i]["R"]) cnt *= w[i]["L"] print(ans) ``` 亲测可过
by 青梧 @ 2018-07-08 15:47:07


|