上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 52 下一页
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5122题意:就是经过几个回合可以使得序列变成有序的,求回合数。思路:数状数组。倒着插入,每次求和,判断在这个数前面是不是有数,只要有数就ans++;最后插入完,ans就是答案。 1 #include 2 #inc... 阅读全文
posted @ 2015-01-15 14:20 null1019 阅读(156) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5108找出最大质因子就可以。 1 #include 2 #include 3 #include 4 #define ll long long 5 #define N 100000 6 using namesp... 阅读全文
posted @ 2015-01-14 20:22 null1019 阅读(164) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5139思路:这道题要先找规律,f(n)=n!*(n-1)!*(n-2)!.....1!; 不能直接打表,而是离线处理,一次性处理出来。 1 #include 2 #include 3 #include 4 #... 阅读全文
posted @ 2015-01-14 19:02 null1019 阅读(136) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5154思路:有向图判断有没有环,可以用floyd。。 1 #include 2 #include 3 #include 4 using namespace std; 5 const int inf=1<<20... 阅读全文
posted @ 2015-01-03 21:43 null1019 阅读(190) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5144题意:给你初始的高度和速度,然后让你求出水平的最远距离。思路:三分枚举角度,然后根据公式求出水平距离。 1 #include 2 #include 3 #include 4 #include 5 us... 阅读全文
posted @ 2015-01-02 21:16 null1019 阅读(404) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5147题意:问有多少个这样的四元组(a,b,c,d),满足条件是 1 2 #include 3 #include 4 #define maxn 50001 5 #define ll long long 6 us... 阅读全文
posted @ 2015-01-02 19:29 null1019 阅读(162) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5146题意:判断这个序列是不是好的,好的要求是在奇数坐标上的数的和等于在偶数坐标上的数的和且这个序列不是回文序列。 1 #include 2 #include 3 #include 4 #define max... 阅读全文
posted @ 2015-01-01 17:53 null1019 阅读(167) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5151题意:一共有N个椅子,然后有N个学生依次去坐,满足下面三个条件不能坐上去,1:这个椅子旁边有左椅子也有右椅子,2:椅子旁边都有人坐了,3:椅子旁边的椅子颜色不一样。问如果所有人都坐上去有多少情况。dp[i][... 阅读全文
posted @ 2015-01-01 17:42 null1019 阅读(180) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5151直接判断是不是素数,然后再注意1就行。 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int n; 7 int a[1001]... 阅读全文
posted @ 2015-01-01 16:43 null1019 阅读(162) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/382/problem/C题意:给你n个数,然后让你添加一个数使得n+1个数能形成这样的规律,a[1]-a[0]=a[2]-a[1]=a[3]-a[2].....,问这样的数有多少个?输出出来。 1 #include 2 #inclu... 阅读全文
posted @ 2014-12-31 20:27 null1019 阅读(197) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 52 下一页