题目大意:输入a,b,c,d,e,f,g,h,i,求2^a+2^b+2^c+2^d+2^e+2^f+2^g+2^h+i
题解:卡高精度内存……膜了一发题解,发现极限数据比ULL大1,特判掉。剩下的就可以乱搞了
我的收获:smg
#include <cstdio>
unsigned long long a[10];
int t;
int main(void) {
scanf("%d", &t);
while (t--) {
for (int i = 0; i <= 8; i++)
scanf("%llu", &a[i]); a[9] = 0;
if (a[8] == 0) {
for (int i = 0; i <= 7; i++)
a[9] += (1LL << a[i]);
printf("%llu\n", a[9]);
}
else {
a[8]--;
for (int i = 0; i <= 7; i++)
a[9] += (1LL << a[i]); a[9] += a[8];
if (a[9] == 18446744073709551615)
printf("18446744073709551616\n");
else printf("%llu\n", a[9] + 1);
}
}
return 0;
}