码迷,mamicode.com
首页 > 其他好文 > 详细

bzoj 2056: gift? 高精度?

时间:2017-01-12 23:05:05      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:input   clu   数据   zoj   数据规模   memory   puts   main   int   

2056: gift? 高精度?

Time Limit: 10 Sec  Memory Limit: 1 MB

Description

 

Input

输入的第一行为一个整数t。 接下来t行,每行包含九个自然数。

Output

输出t行 每行一个整数,表示2^a+2^b+2^c+2^d+2^e+2^f+2^g+2^h+i。

Sample Input

1
21 30 0 0 0 0 0 0 2147483647

Sample Output

3223322629

HINT

 
【数据规模】
40% t<=1000
100% t<=100000 a,b,c,d,e,f,g,h<=60 i<=9223372036854775808

Source

#include<cstdio>
#define ull unsigned long long
ull s,tmp;
int t,a[10];
int main()
{
    scanf("%d",&t);
    while(t--)
    {
        s=0;
        for(int i=0;i<8;i++) scanf("%d",&a[i]);
        scanf("%llu",&tmp);
        for(int i=0;i<8;i++) s+=(1LL<<a[i]);
        if(s!=1LL<<63||tmp!=s) printf("%llu\n",s+tmp);
        else puts("18446744073709551616");
    }
}

 

bzoj 2056: gift? 高精度?

标签:input   clu   数据   zoj   数据规模   memory   puts   main   int   

原文地址:http://www.cnblogs.com/lkhll/p/6279870.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!