摘要: 题目连接:题目 题目大意:给你数列a,b,求在数列a中找出有几个间隔为p的数列b 解题思路:直接暴力,复杂度n*m, #include#includeusing namespace std;const int maxn = 1e6+5;int a[maxn],b[maxn];int n,m,p;... 阅读全文
posted @ 2016-10-19 21:26 hong-ll 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 题目连接:题目 题目大意: 给出N,K,给你1~n个数,在所有全排列中相邻的两个数的gcd的和第K大的排列,排列有多种,输出其中一种 解题思路: 设,p是左右gcd的和,则p是从n-1,开始的连续数字 当k==1时就是输出从1~n 当k时偶数时,把k和2*k提到最前面,因为k和2*k的最大公约数... 阅读全文
posted @ 2016-10-19 21:22 hong-ll 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 题目链接:题目 题目大意:给你1~n(1#includeusing namespace std;int a[]={0,0,0,0,1,1,2,3,3,4,5,6,7,7,8,9,10,11,12,13,14};int main(){ int t; int ca=1; scanf("%d",&t)... 阅读全文
posted @ 2016-10-19 20:31 hong-ll 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 题目连接:题目 求公式结果,数据量比较小,递归一下就行了,和某年的蓝桥杯一个题一样 #include#include#include#includeusing namespace std;const int maxn = 10;int n;int a[maxn],b[maxn];int gcd(... 阅读全文
posted @ 2016-10-19 20:26 hong-ll 阅读(139) 评论(0) 推荐(0) 编辑