摘要: Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to 阅读全文
posted @ 2017-05-20 18:14 HaipaiAcm 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 时间复杂度:计算机科学中,算法的时间复杂度是一个函数,它定量描述了该算法的运行时间(百度)。时间复杂度常用来估算一个程序在n为一定值的时候需要的时间,来判断你的算法是否高效。 通常时间复杂度和渐进时间复杂度不做区分。下面给例题。 1:a=b;b=c;a=c; T(n)=1。 2:(1) x=0;y= 阅读全文
posted @ 2017-02-12 14:52 HaipaiAcm 阅读(1033) 评论(0) 推荐(0) 编辑
摘要: 以下是本人自己的看法,如果有不对请指出: 快速幂其实就是一种简化计算幂所需时间的方法 ; 模板代码如下: 假设求 a^b%mod int res=1; while(b) { if(b&1) res=res*a%mod [1] // (b&1)是二进制的与,用于判断最低位是否有1; 这里运用了模的基本 阅读全文
posted @ 2017-01-19 12:29 HaipaiAcm 阅读(162) 评论(0) 推荐(0) 编辑
摘要: For each assingnement there is the only one line of output. On this line, there is a number, the result of expression (A1B1+A2B2+ ... +AHBH)mod M. (A1 阅读全文
posted @ 2017-01-19 10:43 HaipaiAcm 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Fighting· 阅读全文
posted @ 2017-01-18 10:30 HaipaiAcm 阅读(90) 评论(0) 推荐(0) 编辑