
ACM题解
文章平均质量分 58
zzj_joker
这个作者很懒,什么都没留下…
展开
-
hdoj1029(基础DP)
题目:杭电oj1029 题意:给N个数(N为奇数)问,那个数至少出现了(N+1)/2遍(PS.这个数是一定会存在的虽然题目没说有) 思路:先排序,因为至少出现了(N+1)/2遍,而且已经排好序了,直接检查i与第(N+1)/2是否相同就行了,相同则 退出。#include #include #include #include using namespace std; int main()原创 2017-09-13 18:35:15 · 316 阅读 · 0 评论 -
2017 ACM/ICPC Asia Regional Shenyang Online//string string string(后缀自动机,未学习)
题目链接:string string string 题意:一个字符串,多少个字符串恰好出现K次。 Output For each test case, print the number of the important substrings in a line. Sample Input 2 2 abcabc 3 abcabcabcabc转载 2017-09-12 21:32:33 · 236 阅读 · 0 评论 -
2017 ACM/ICPC Asia Regional Shenyang Online//array array array
题目链接:array array array 题意:去除N个数后是否是升序或者降序,是则输出A is a magic array. 不是则输出A is not a magic array; 这里开始想这直接暴力破解应该会超时的,尽管实现出来应该不难,就没有下手,一直想着优化,没想到直接暴力破解就行了。直接码代码吧。#include #include #include using na原创 2017-09-12 20:07:22 · 261 阅读 · 0 评论 -
2017 ACM/ICPC Asia Regional Shenyang Online//number number number
题目链接:number number number 思路:一个个推,发现K=1时,N=F5-1=4;K=2,N=F7-1=12;K=3,N-F9-1=33.推断出N=F(2*K+3)-1,就是求2*K+3的斐波那契数列。原创 2017-09-11 20:02:49 · 224 阅读 · 0 评论 -
2017 ACM/ICPC Asia Regional Shenyang Online//cable cable cable题解
题目链接:cable cable cable; 题目思路是不难的,手动模拟一下就可以了,困难在于如何理解题意。 题意是存在M个显示器,K个不同的信号源(不同信号源的颜色不同,且只会通到一个显示屏)(K 案例:输入为(M K) Sample Input 3 2 20 15 Sample Output 4 90 以M==3,K==2为例:原创 2017-09-11 16:52:03 · 257 阅读 · 0 评论