2056: gift? 高精度?
来源:互联网 发布:青铜 知乎 编辑:程序博客网 时间:2024/06/05 08:58
题目链接
题目大意:输入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;}
0 0
- bzoj 2056: gift? 高精度?
- 2056: gift? 高精度?
- [BZOJ2056][gift? 高精度?][水题]
- bzoj2056 gift? 高精度?
- GIFT
- gift
- Gift
- 高精度
- 高精度
- 高精度
- 高精度。。
- 高精度
- 高精度
- 高精度
- 高精度
- 高精度
- 高精度
- 高精度
- AVAssetWriter写h264数据
- 6.Oracle:安装oracle11g INS-30131执行安装程序验证所需的初始设置失败的解决方法
- 自己实现的一个简易Spring框架(IoC+AOP)
- Android ADB
- JS创建对象的各种方法
- 2056: gift? 高精度?
- 历经8年双11流量洗礼,淘宝开放平台如何攻克技术难关?
- tomcat配置文件详解
- 模幂运算
- Maven Scope取值的含义
- 创建用户,表空间,导入新数据库
- 蓝桥杯之承压计算
- vim实现快速切换主题
- JavaBean使用