zoukankan      html  css  js  c++  java
  • bzoj 2056: gift? 高精度?

    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
    ",s+tmp);
            else puts("18446744073709551616");
        }
    }

    版权声明:本文为博主原创文章,未经博主允许不得转载。

  • 相关阅读:
    调用打印预览问题
    html2canvas+Canvas2Image分享海报功能踩坑
    SQL Server – Show/Hide Results Pane in Management Studio 2012
    jQuery
    Sap PI 接口配置
    WebService 错误解决记录
    线程
    HTML和CSS
    C#高编
    MVC3
  • 原文地址:https://www.cnblogs.com/lkhll/p/6279870.html
Copyright © 2011-2022 走看看