跳到正文

wwz1428572008

268951

First comes blood / Then we perish / Then comes Death in his Eternity Carriage.

在洛谷打开
资料、奖项与版本

资料

编号
268951
抓取

奖项

2023 CSP-S
一等奖
2022 CSP-J
一等奖
2022 CSP-S
二等奖
2021 CSP-S
三等奖
2020 CSP-J
一等奖
2019 CSP-J
二等奖

The Zen of Python

Tim Peters

Beautiful is better than ugly.

Explicit is better than implicit.

Simple is better than complex.

Complex is better than complicated.

Flat is better than nested.

Sparse is better than dense.

Readability counts.

Special cases aren’t special enough to break the rules.

Although practicality beats purity.

Errors should never pass silently.

Unless explicitly silenced.

In the face of ambiguity, refuse the temptation to guess.

There should be one— and preferably only one —obvious way to do it.

Although that way may not be obvious at first unless you’re Dutch.

Now is better than never.

Although never is often better than right now.

If the implementation is hard to explain, it’s a bad idea.

If the implementation is easy to explain, it may be a good idea.

Namespaces are one honking great idea — let’s do more of those! 相对论 瀑布

共 2 篇
  1. 题解

    题解:P11056 Fire and Big

    考试时写了一个 O(n√n) 的做法,但常数比较大,只有 75 分。考完经过改进,AC 了本题。 做法 维护对于每个 n 先手必胜还是后手必胜。如果一个点可以在取后转换到后手必胜点,则它是先手必胜点,否则它是后手必胜点。所以可以在每个后手必胜点处向后更新,并记录。 由于任意 n …

  2. 题解

    B3629题解

    该代码通过二分法解决冰棍兑换问题。核心思路是:当初始购买x根冰棍时,每3根木棒可兑换1根冰棍并产生新的木棒。最终能吃到的冰棍数随初始数量增加而单调不减,因此可通过二分法确定最小的初始数量。chk函数模拟兑换过程,计算最终可吃到的冰棍数是否≥n。二分查找范围设定为[1,1e8],最终输出满足条件的最小初始冰棍数。算法时间复杂度为O(log n),高效处理大范围输入。