摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5690 题意:m个数字全为x mod k ?= c;其中m <= 1010,0 < c,k <= 10,000; 法1:xxx = (10m-1)/9*x;但是n太大,需要同时mod。去除分母将式子变为: 阅读全文
posted @ 2016-07-24 23:15 hxer 阅读(408) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5738 题意:从n(n <= 1000)个点(有重点)中选出m(m > 1)个点(选出的点只看标号,不看具体坐标)合成一个集合,问集合中的点共线(可以重合)的集合个数? 思路:按照x,y双关键字排序,之后 阅读全文
posted @ 2016-07-24 22:57 hxer 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5719 题意:一个数列为1~N的排列,给定mn[1...n]和mx[1...n],问有符合的排列数为多少?如果不存在,输出0; 思路: 有解的几种条件: 1. mn , mx 变化单调; 2. mn,mx 阅读全文
posted @ 2016-07-24 22:38 hxer 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5720 题意:有n(n <= 105)个数 ,每个数小于等于 1018;问在给定的[L,R]区间中,有多少个数不能与已知的n个数中的任何两个组成三角形? 思路:由三角形的边长关系移位即可得到符合关系的长度 阅读全文
posted @ 2016-07-24 22:26 hxer 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 链接:http://acm.hdu.edu.cn/showproblem.php?pid=5724 题意:一个n*20的棋盘,n <= 1000;棋盘上有一些棋子,每颗棋子只能移动到右边的第一个空格。不能移动者输;其中 Alice先手;如果Alice能赢输出"YES"; 思路:每个子游戏的大小只有2 阅读全文
posted @ 2016-07-24 22:15 hxer 阅读(295) 评论(0) 推荐(0) 编辑
摘要: 链接:http://acm.hdu.edu.cn/showproblem.php?pid=5726 题意:有N(N <= 100,000),之后有Q(Q <= 100,000)个区间查询[l,r]。问ans1 = gcd(al,al+1,...ar) = ?,并且有多少组[l',r'] 的gcd值等 阅读全文
posted @ 2016-07-24 22:06 hxer 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 链接:http://acm.hdu.edu.cn/showproblem.php?pid=5727 题意:由2*N颗宝石构成的环(阴阳宝石均为N颗且标号均从1~N) 之后给定M组 a,b;表示阳宝石a若和阴宝石b相邻会使得阳宝石变暗,问所构成的环中阳宝石变暗的最少数量? 其中(1<=N<=9, 1< 阅读全文
posted @ 2016-07-24 21:39 hxer 阅读(133) 评论(0) 推荐(0) 编辑