其他
有趣的小程序
洛洛兮
这个作者很懒,什么都没留下…
展开
-
2020 牛客多校 Groundhog and 2-Power Representation
题目描述 输入与输出描述 示例与备注 题目大意 给你一行字符串,根据题目要求输出其计算结果。 2(n)意思为2n。 代码 print(eval(input().replace('(','**('))) 这道题用C或C++写起来无疑是很麻烦的,作者作为一个菜鸡并不会用C++解决这道题。而如果用python就会变得特别简单,一行代码解决问题。 我们从右往左看 input().replace('(','**(') # 就是将输入的字符串中的“(”替换为“”, # 那么2(n)就被替换为2**(n) # 而原创 2020-08-11 10:26:08 · 129 阅读 · 0 评论 -
2020牛客多校 The Crime-solving Plan of Groundhog
题目描述 Today, ZLZX has a mysterious case: Orange lost his down jacket hanging in his dorm room. Under the expectations of everyone, detective Groundhog took his small spoon of the artifact and started the journey to solve the case. After an in-depth investig原创 2020-08-08 16:35:37 · 192 阅读 · 0 评论 -
2020牛客多校 Clam and Fish
题目描述 There is a fishing game as following: The game contains nn stages, numbered from 11 to nn. There are four types of stages (numbered from 00 to 33): type 0: There are no fish and no clam in this stage. type 1: There are no fish and one clam in th原创 2020-07-21 17:14:57 · 180 阅读 · 0 评论 -
2020暑期牛客多校 F Infinite String Comparision
题目描述: For a string xx, Bobo defines x ∞=xxx…,which is xx repeats for infinite times, resulting in a string of infinite length. Bobo has two strings aa and bb. Find out the result comparing a∞and b∞in lexicographical order.You can refer the wiki page for fu原创 2020-07-12 18:19:16 · 189 阅读 · 0 评论