摘要: Plants vs. ZombiesTime Limit:5000msMemory Limit:2048KB64-bit integer IO format:%lld Java class name:MainPrevSubmitStatusStatisticsDiscussNextFont Size:+-Type:Tag it!植物大战僵尸(Plants vs. Zombies)是一款风靡全球的小游戏,游戏中可怕的僵尸即将入侵你的家庭,你唯一的防御方式就是你栽种的植物。一天早上起床,你惊讶地发现,游戏变成了事实:一大堆各种各样的僵尸正准备入侵你的寝室!而且僵尸种类远远多于游戏中的(有10000 阅读全文
posted @ 2013-10-01 18:41 芷水 阅读(303) 评论(0) 推荐(0) 编辑
摘要: http://www.bnuoj.com/bnuoj/problem_show.php?pid=4067美丽的花环Time Limit:1000msCase Time Limit:1000msMemory Limit:65536KBSpecial Judge64-bit integer IO format:%lld Java class name:MainSubmitStatusFont Size:+-学校的草坪上最近种植了一些漂亮的花卉,所有的花围成了一个环形(内径为r,外径为R,0 7 #include 8 #include 9 #include10 using namespace st. 阅读全文
posted @ 2013-10-01 18:39 芷水 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Prime TestTime Limit:6000MSMemory Limit:65536KTotal Submissions:27129Accepted:6713Case Time Limit:4000MSDescriptionGiven a big integer number, you are required to find out whether it's a prime number.InputThe first line contains the number of test cases T (1 10 #include 11 #include 12 #include 1 阅读全文
posted @ 2013-10-01 14:34 芷水 阅读(392) 评论(0) 推荐(0) 编辑
摘要: 1 //**************************************************************** 2 // Miller_Rabin 算法进行素数测试 3 //速度快,而且可以判断 =mod)19 ans=ans-mod;20 }21 a=a=mod) a=a-mod;23 b=b>>1;24 }25 return ans;26 }27 28 LL pow_mod(LL a,LL b,LL mod) // a^b%mod29 {30 LL ans=1;31 ... 阅读全文
posted @ 2013-10-01 14:31 芷水 阅读(381) 评论(0) 推荐(0) 编辑
摘要: 1 //************************************************ 2 //pollard_rho 算法进行质因数分解 3 //************************************************ 4 5 LL factor[100];//质因数分解结果(刚返回时是无序的) 6 int tol;////质因数的个数。数组小标从0开始 7 8 LL gcd(LL a,LL b) 9 {10 if(a==0) return 1;// !!!!11 if(a=n)48 p=Pollard_rho(p,r... 阅读全文
posted @ 2013-10-01 14:30 芷水 阅读(530) 评论(0) 推荐(0) 编辑