sdnuoj1537(大数)

Tiger Eat People
Description

As we all know, lls is the boss of SDNU ACM Training Team, so many team members may be afraid of him. But this is not the case, lls is very kindly to us. To show his love to us, he plan to give all of us an “Accepted”. The problem shows as follows:There are n numbers ​.Each time you can choose a subset of them(may be empty), and then add them up.Count how many numbers can be represented in this way.

Input

The first line of the input contains an integer T, denoting the number of test cases.
In each test case, there is a single integers n in one line, as described above.
, ​

Output

For each test case, output one line contains a single integer, denoting the answer.

Sample Input

4
9
7
8
233

Sample Output

512
128
256
13803492693581127574869511724554050904902217944340773110325048447598592

看的同学的博客hhh

#include<bits/stdc++.h>
using namespace std;
int main()
{
   
    int t,n;
    unsigned long long m;
    scanf("%d",&t);
    while(t--)
    {
   
        scanf("%d",&n);
        //std::setprecision()控制输出n位有效数字
        //与fixed连用表示控制输出到小数点后几位
        //没有这俩会用e表示输出
        cout<<fixed<<std::setprecision(0)<<pow(2,n)<<'\n';
    }
    return 0;
}

全部评论

相关推荐

01-30 22:03
门头沟学院 Java
用微笑面对困难:我滴妈,【俩月】【实习】【主管】仨debuff吃满了,独立设计开发的项目写了绝大占比的运营板块,你独立开发,那维护、问题复盘、日志更新、bug、策划书全是自己整的? 不建议写那么大,可以从小出发更容易
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务