摘要: /*分析: 摘: 本题的意思是:整数划分问题是将一个正整数n拆成一组数连加并等于n的形式,且这组数中的最大加数不大于n。 如6的整数划分为 6 5 + 1 4 + 2, 4 + 1 + 1 3 + 3, 3 + 2 + 1, 3 + 1 + 1 + 1 2 + 2 + 2, 2 + 2 + 1 + 阅读全文
posted @ 2019-07-29 10:02 啊哈啦 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Gym 101350I - Mirrored String II ( Manacher马拉车算法 -- 最长回文子串 ) 题意 给一个字符串, 求最长回文镜像子串长度 思路 Manacher + 镜像判断 算法实现 : Manacher算法总结 AC代码 ( kuangbin板子 ) #includ 阅读全文
posted @ 2019-07-26 18:15 啊哈啦 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, }; 它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求 阅读全文
posted @ 2019-07-25 12:50 啊哈啦 阅读(669) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h>#define FER freopen("input.txt","r",stdin);#define FEW freopen("output.txt","w",stdout);using namespace std;const int maxn=100; 阅读全文
posted @ 2019-07-24 10:03 啊哈啦 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 题目链接:Great Cells 题意:有一张N*M的格子纸,每个格子可以填1到K之间的数。如果一个格子里的数严格大于本行的其他格子里的数,并且严格大于本列的的其他格子里的数,则这个格子叫做Great Cell。Ag表示有Ag种填法使得格子纸中恰有g个Great Cell。 求: 思路: 代码: # 阅读全文
posted @ 2019-07-23 19:41 啊哈啦 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 版权声明:Vici__ https://blog.csdn.net/Vici__/article/details/82951744题意:给出n个冰淇淋球,做一个冰淇淋需要k个冰淇淋球,要求相邻的两个球:下面的球的质量大于等于其上面的那个球质量的两倍。 给出n个数(n个冰淇淋球的质量),求最多能做几个 阅读全文
posted @ 2019-07-23 18:24 啊哈啦 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 用dfs时就说一个问题有很多层,重这一层到下一层用dfs,一层跑完后retuen,然后回到原来的状态,如果一层中有多个情况,就需要跑一个循环 #include<bits/stdc++.h>#include<algorithm>using namespace std;int res[5],t[5],a 阅读全文
posted @ 2019-07-23 16:34 啊哈啦 阅读(174) 评论(0) 推荐(0) 编辑
摘要: #include <cstdio>#include <cstdlib>#include<cstring>#include<algorithm>#include<string>#include<vector>#include<iostream>#include<set>#include<iomanip 阅读全文
posted @ 2019-04-02 19:26 啊哈啦 阅读(95) 评论(0) 推荐(0) 编辑
摘要: #include <cstdio>#include <cstdlib>#include<cstring>#include<algorithm>#include<string>#include<vector>#include<iostream>#include<set>#include<map>#in 阅读全文
posted @ 2019-03-20 20:44 啊哈啦 阅读(172) 评论(0) 推荐(0) 编辑