摘要: 就是在能取大的尽量取大的 比如在可以用二分查找的方法; 有时间限制的题目,可以从时间的最后面的开始分配,尽量不浪费; 有多种解决方法的,用多种解决方法算出来,比较哪种更好; 重点就是一个字“大” 阅读全文
posted @ 2018-07-23 14:29 一无所知小白龙 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 要求(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 阅读全文
posted @ 2018-07-23 14:25 一无所知小白龙 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 一般数据比较大的时候,让你找满足条件的最小值中的最大值,或者最大的最小值可以用二分; 设下限为0,上限的最大的条件; 最后求出来的就是所需要的值; 如果K是1,也就是题目要求的是整数的时候,要加上 因为这时可能会有特殊的没法考虑,加上这个才能确定真正的答案! 还有一个stl函数binary_sear 阅读全文
posted @ 2018-07-23 12:15 一无所知小白龙 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 给出组合数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 阅读全文
posted @ 2018-07-23 12:05 一无所知小白龙 阅读(328) 评论(0) 推荐(0) 编辑
摘要: A group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arrangement mu 阅读全文
posted @ 2018-07-22 21:56 一无所知小白龙 阅读(144) 评论(0) 推荐(1) 编辑
摘要: 杂货店出售一种由N(3 include include include include include define sf scanf define pf printf define cl clear() define pb push_back define mm(a,b) memset((a),( 阅读全文
posted @ 2018-07-22 20:07 一无所知小白龙 阅读(116) 评论(0) 推荐(0) 编辑
摘要: We have received an order from Pizoor Communications Inc. for a special communication system. The system consists of several devices. For each device, 阅读全文
posted @ 2018-07-22 18:12 一无所知小白龙 阅读(319) 评论(0) 推荐(1) 编辑
摘要: A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral n 阅读全文
posted @ 2018-07-22 16:32 一无所知小白龙 阅读(255) 评论(0) 推荐(1) 编辑
摘要: My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F 阅读全文
posted @ 2018-07-22 14:09 一无所知小白龙 阅读(277) 评论(0) 推荐(0) 编辑
摘要: Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea 阅读全文
posted @ 2018-07-22 14:06 一无所知小白龙 阅读(293) 评论(0) 推荐(0) 编辑