Description
无
Input
输入的第一行为一个整数t。
接下来t行,每行包含九个自然数。
Output
输出t行
每行一个整数,表示2a+2b+2c+2d+2e+2f+2g+2h+i。
Sample Input
1
21 30 0 0 0 0 0 0 2147483647
Sample Output
3223322629
Data Constraint
Hint
【数据规模】
40% t<=1000
100% t<=100000 a,b,c,d,e,f,g,h<=60 i<=9223372036854775808
.
.
.
.
.
分析
注意:

水题,数据类型+特判
.
.
.
.
.
程序:
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
unsigned long long i,ans,bz=(unsigned long long)9223372036854775807+1;
int a,b,c,d,e,f,g,h;
long long s[61];
int main()
{
int t;
scanf("%d",&t);
s[0]=1;
for (int w=1;w<=60;w++)
s[w]=s[w-1]*2;
while (t--)
{
scanf("%d%d%d%d%d%d%d%d%llu",&a,&b,&c,&d,&e,&f,&g,&h,&i);
if (a==b&&b==c&&c==d&&d==e&&e==f&&f==g&&g==h&&i==bz)
{
printf("18446744073709551616\n");
continue;
}
ans=s[a]+s[b]+s[c]+s[d]+s[e]+s[f]+s[g]+s[h]+i;
printf("%llu\n",ans);
}
return 0;
}

博客给出一个整数计算程序的输入输出要求,输入第一行为整数t,后续t行每行九个自然数,输出t行,每行是特定表达式结果。还给出了数据规模,分析指出这是水题,需注意数据类型和特判。
2240

被折叠的 条评论
为什么被折叠?



