摘要: 1.randomDescription 给定4个参数A0,N,c,p,你需要按下式构造A1~AN: A[i]=(A[i-1]2+c)mod p 之后,你需要求出A1~AN中,第K大的数值。Input 一行五个正整数A0,N,c,p,K。Output 一行一个整数,描述答案。Sample Input 阅读全文
posted @ 2016-04-06 22:31 Yangjiyuan 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 可以算出合并多少次。 1 #include<algorithm> 2 #include<iostream> 3 #include<cstdlib> 4 #include<cstring> 5 #include<cstdio> 6 #include<cmath> 7 using namespace s 阅读全文
posted @ 2016-04-06 20:09 Yangjiyuan 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 距离一个点最远的点一定是直径的一个端点。考虑运用这个原理,每次维护一下直径端点即可。 阅读全文
posted @ 2016-04-06 20:06 Yangjiyuan 阅读(172) 评论(0) 推荐(0) 编辑