Gift

206 篇文章 0 订阅

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;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值