首页 > Groundhog and 2-Power Representation
头像 NaruseShiroha
发表于 2020-08-08 17:04:28
A-Groundhog and 2-Power Representation python nb一行代码解决问题 print(eval(input().replace('(', '**(')))
头像 NaruseShiroha
发表于 2020-08-08 18:28:23
I-The Crime-solving Plan of Groundhog python 继续nb t = int(input()) for ts in range(0, t): n = int(input()) data = list(map(int, input().split( 展开全文
头像 北冥12131
发表于 2024-05-08 09:21:05
核心思路: 这个题目的数据范围很吓人 1e180,c++肯定需要使用高精度; 但是经过推算发现pow(2 , 600)正好是 1e180; 所以只有最后一步需要使用高精度。 具体步骤: 第一步:分组,例如可以将示例分为: ["(2(2+2(0))+2)", "(2(2+2(0)))", "(2 展开全文
头像 sunrise__sunrise
发表于 2020-08-20 00:49:06
A、Groundhog and 2-Power Representation Python的签到题,会Python就很简单,直接替换加eval就行了 s = input() s = s.replace('(', '**(') print(eval(s)) F、Groundhog Looking D 展开全文
头像 zjnu_tjq
发表于 2020-08-08 18:30:17
链接:https://ac.nowcoder.com/acm/contest/5674/A来源:牛客网 题意: 给你一个字符串,里面只存在0,2,(,),+这几个字符,问你这个字符串是由那个数分解而来的a(b)代表a的b次,而b这个数又是由若干个数相加##solution:我们将字符串转换为数字,字 展开全文
头像 TitanZhang
发表于 2020-08-08 18:59:38
题目大意 输入计算式,求解。其中2(x)表示2的x次方,式中每一项都对应着答案在二进制表示下的数位为1的位。 解题思路 高精度快速幂,冲冲冲!但是要注意的是具体实现时的细节(队友的高精度写的一堆Bug),还有读入时一层层递归下去。 AC代码 #include<bits/stdc++.h> 展开全文
头像 梁好问tanget90°
发表于 2020-08-08 20:45:28
原题链接:https://ac.nowcoder.com/acm/contest/5674/A 题目描述 某日,土拨鼠(Groundhog)在数学课上得知:任何正整数可以变成2的幂的形式以上为废话。输入表达式(字符串),并把字符串转化为原10进制形式。 输入描述 输入一行字符串,作为2的幂的形 展开全文
头像 offer自动机
发表于 2020-09-03 14:58:28
题目描述   Groundhog took a math class. In this class, his math teacher said, any positive integer can be represented by the power of . For example, .  An 展开全文