【杭电5363】Key Set

来源:互联网 发布:淘宝上传工具 编辑:程序博客网 时间:2024/06/05 18:50

这里写图片描述
这里写图片描述

#include<stdio.h>#define N 1000000007__int64 quickpow(int a,int b) {    __int64 ans=1,base=a;    while(b) {        if(b&1) {            ans=ans*base%N;        }        base=base*base%N;        b>>=1;    }    return ans;}int main() {    int T;    scanf("%d",&T);    while(T--) {        int n;        scanf("%d",&n);        __int64 t;        t=quickpow(2,n-1)-1;        printf("%I64d\n",t);    }    return 0;}[http://acm.hdu.edu.cn/showproblem.php?pid=5363](http://acm.hdu.edu.cn/showproblem.php?pid=5363)
0 0
原创粉丝点击