• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

Recommended Posts

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1061

水题快速幂,求余进行最后一个取尾操作就可以,坑点不大,

直接上代码:

Talk is cheap. Show me the code.

#includebits/stdc .h

使用命名空间标准

long long t;

龙龙fastpow(龙龙一,龙龙b)

{

长长基=a;

long long RES=1;

而(二)

{

如果(b1)

res=(res*base);

base=(base*base);

b=1;

}

返回表示留数

}

int main()

{

STD : IOs : sync _ with _ stdio(false);

CIN。平局(0);

cout。平局(0);

转换成整形

while(t -)

{

龙龙n;

桂皮酸

long long ans=0;

ans=fastpow(n,n);

coutansendl

}

返回0;

}

Link to comment
Share on other sites