摘要:
就是在能取大的尽量取大的 比如在可以用二分查找的方法; 有时间限制的题目,可以从时间的最后面的开始分配,尽量不浪费; 有多种解决方法的,用多种解决方法算出来,比较哪种更好; 重点就是一个字“大” 阅读全文
摘要:
要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。 Input 数据的第一行是一个T,表示有T组数据。 每组数据有两个数n(0 include include include include include def 阅读全文
摘要:
一般数据比较大的时候,让你找满足条件的最小值中的最大值,或者最大的最小值可以用二分; 设下限为0,上限的最大的条件; 最后求出来的就是所需要的值; 如果K是1,也就是题目要求的是整数的时候,要加上 因为这时可能会有特殊的没法考虑,加上这个才能确定真正的答案! 还有一个stl函数binary_sear 阅读全文
摘要:
给出组合数C(n,m), 表示从n个元素中选出m个元素的方案数。例如C(5,2) = 10, C(4,2) = 6.可是当n,m比较大的时候,C(n,m)很大!于是xiaobo希望你输出 C(n,m) mod p的值! Input 输入数据第一行是一个正整数T,表示数据组数 (T include i 阅读全文