2012年6月2日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1194跟着狗畅找了道水题做,他真无聊啊。。。View Code #include <iostream>using namespace std ;int main(){ int n,i; int s,d; scanf("%d",&n); while(n--) { scanf("%d%d",&s,&d); for(i=s;i>0;i--) if(abs(i*2-s)==d) { pr... 阅读全文
posted @ 2012-06-02 17:55 LegendaryAC 阅读(237) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2161素数判断,这题数据范围小的可怜,普通的筛法肯定没问题,不过为了练习我还是拿米勒拉宾测试写的。ps:为2b的自己流了一地泪View Code #include <iostream>using namespace std ;__int64 qpow(int a,int b,int r){ __int64 ans=1,buff=a; while(b) { if(b&1)ans=(ans*buff)%r; buff=(buff*buff)%r; b>>... 阅读全文
posted @ 2012-06-02 13:21 LegendaryAC 阅读(163) 评论(0) 推荐(0) 编辑