05 2019 档案

摘要:"坏掉的项链Broken Necklace" 难度:★ Code: 阅读全文
posted @ 2019-05-30 21:37 Mystery_Sky 阅读(234) 评论(0) 推荐(0) 编辑
摘要:"黑色星期五" 难度:☆ Code: c++ include include include using namespace std; //Mystery_Sky // int day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} 阅读全文
posted @ 2019-05-30 20:12 Mystery_Sky 阅读(264) 评论(0) 推荐(0) 编辑
摘要:"你的飞碟在这儿" 难度:☆ Code: c++ include include include using namespace std; int jisuan(char a[]); int main() { char a[7] = {}; char b[7] = {}; cin a; cin b; 阅读全文
posted @ 2019-05-30 20:11 Mystery_Sky 阅读(152) 评论(0) 推荐(0) 编辑
摘要:"贪婪的送礼者Greedy Gift Givers" 难度:☆ Code: c++ include include include include using namespace std; //Mystery_Sky // struct People{ char name[20]; int out, 阅读全文
posted @ 2019-05-30 19:26 Mystery_Sky 阅读(230) 评论(0) 推荐(0) 编辑
摘要:"机器人搬重物" ~~咕咕咕了几个星期,终于静下心来写完了这篇题解~~ 这道题的坑点还是比较多的,下面会一一列举。 先审题: ​ 根据题目的意思,这是一道走迷宫的问题,显然用bfs去求解。 ​ 首先,我们需要建一张图。。。 ​ 这里很多人下意识地将题目中输入的图存下,这就涉及到了此题的第一个坑点了: 阅读全文
posted @ 2019-05-25 22:17 Mystery_Sky 阅读(253) 评论(0) 推荐(0) 编辑
摘要:~~别问我为什么是指针~~ 单点修改+区间查询 阅读全文
posted @ 2019-05-24 20:51 Mystery_Sky 阅读(139) 评论(0) 推荐(0) 编辑
摘要:"刺杀大使" 一道并不难的二分题,竟让我交了上20次,诶,果然还是我太弱了。 看完题目就基本想到要怎么做了: 只需要对最小伤害代价进行二分即可,check()函数里用搜索判断是否可以到达最后一行,这里的check()用深搜广搜都可以,两种的代码下面都会给出,而经过检验,这道题目用深搜会优于广搜。 如 阅读全文
posted @ 2019-05-19 17:15 Mystery_Sky 阅读(176) 评论(0) 推荐(0) 编辑
摘要:"Best Cow Fences" 二分答案 + 前缀和 个人认为题意没有表述清楚,本题要求的是满足题意的连续子序列(~~难度大大降低了有木有~~)。 ~~本题的精度也是非常令人陶醉,请您自行体会吧!~~ 阅读全文
posted @ 2019-05-16 21:33 Mystery_Sky 阅读(626) 评论(0) 推荐(0) 编辑
摘要:"路标设置" 二分枚举”空旷指数“, 做法与跳石头类似。 cpp include include include using namespace std; //Mystery_Sky // define M 10000100 define INF 0x7f7f7f7f define ll long 阅读全文
posted @ 2019-05-16 20:51 Mystery_Sky 阅读(213) 评论(0) 推荐(0) 编辑
摘要:"时间管理Time Management" 二分枚举开始时间。 cpp include include include using namespace std; //Mystery_Sky // define ll long long define M 10001000 define INF 0x7 阅读全文
posted @ 2019-05-16 20:28 Mystery_Sky 阅读(190) 评论(0) 推荐(0) 编辑
摘要:"砍树" 二分答案,难度较低。 cpp include include include using namespace std; //Mystery_Sky // define M 10000100 define ll long long define INF 0x7f7f7f7f ll l, r, 阅读全文
posted @ 2019-05-16 20:05 Mystery_Sky 阅读(131) 评论(0) 推荐(0) 编辑
摘要:"愤怒的牛" 二分答案模板题 cpp include include include using namespace std; //Mystery_Sky //二分查找(模板) define M 1000010 define ll long long define Mid (l+r+1)/2 int 阅读全文
posted @ 2019-05-16 19:55 Mystery_Sky 阅读(228) 评论(0) 推荐(0) 编辑
摘要:"最长路" cpp include include include include include using namespace std; //Mystery_Sky // define maxn 1000010 define maxm 5000050 define INF 0x3f3f3f3f 阅读全文
posted @ 2019-05-11 21:05 Mystery_Sky 阅读(93) 评论(0) 推荐(0) 编辑
摘要:"旅行计划" 待证明这样dp的正确性。 cpp include include include include using namespace std; //Mystery_Sky // define maxn 1000010 define maxm 5000050 define INF 0x3f3 阅读全文
posted @ 2019-05-11 21:05 Mystery_Sky 阅读(89) 评论(0) 推荐(0) 编辑
摘要:```cpp include include include include using namespace std; //Mystery_Sky // define maxn 1000010 struct Edge{ int to, next; }edge[maxn]; int vis[maxn] 阅读全文
posted @ 2019-05-11 21:04 Mystery_Sky 阅读(119) 评论(0) 推荐(0) 编辑
摘要:题目 floyd的一道比较好的题目 阅读全文
posted @ 2019-05-11 21:04 Mystery_Sky 阅读(73) 评论(0) 推荐(0) 编辑
摘要:"混合背包" 混合背包模板题。 阅读全文
posted @ 2019-05-10 20:44 Mystery_Sky 阅读(622) 评论(0) 推荐(0) 编辑
摘要:"数字组合" 01背包的变式。 做完这道题之后建议去做一做 "货币系统" 。 阅读全文
posted @ 2019-05-10 20:33 Mystery_Sky 阅读(433) 评论(0) 推荐(0) 编辑
摘要:"买书" "货币系统" 的简化版,注意特判0。 cpp include include using namespace std; //Mystery_Sky // define ll long long define M 10000 int v, m; ll c[M], f[M]; int main 阅读全文
posted @ 2019-05-10 20:27 Mystery_Sky 阅读(609) 评论(0) 推荐(0) 编辑
摘要:"P1474 货币系统 Money Systems" !! 不是noip2018的那道题。 简单的多重背包的变式。 cpp include include using namespace std; //Mystery_Sky // define ll long long define M 10000 阅读全文
posted @ 2019-05-10 20:23 Mystery_Sky 阅读(248) 评论(0) 推荐(0) 编辑
摘要:"庆功会" 多重背包模板 比01背包多了一个将某种物品拆分的过程。 阅读全文
posted @ 2019-05-10 20:22 Mystery_Sky 阅读(913) 评论(0) 推荐(0) 编辑
摘要:"公共子序列" 多组输入的 "最长公共子序列" 。 cpp include include include include using namespace std; //Mystery_Sky // define M 1000 string s1, s2; int f[M][M], len1, le 阅读全文
posted @ 2019-05-10 19:50 Mystery_Sky 阅读(488) 评论(0) 推荐(0) 编辑
摘要:"方格取数" cpp include include using namespace std; //Mystery_Sky // define M 11 int f[M][M][M][M], a[M][M]; int n, x, y, z; int max1, max2; int main() { 阅读全文
posted @ 2019-05-10 19:37 Mystery_Sky 阅读(411) 评论(0) 推荐(0) 编辑
摘要:"装箱问题" 01背包的变式,费用=价值。 阅读全文
posted @ 2019-05-09 21:10 Mystery_Sky 阅读(779) 评论(0) 推荐(0) 编辑
摘要:"完全背包问题" 完全背包模板题 cpp include include using namespace std; //Mystery_Sky //完全背包模板 define M 1010 int f[M], c[M], w[M]; int v, m, ans; int main() { scanf 阅读全文
posted @ 2019-05-09 20:57 Mystery_Sky 阅读(750) 评论(0) 推荐(1) 编辑
摘要:"采药" 01背包模板题。 阅读全文
posted @ 2019-05-09 20:55 Mystery_Sky 阅读(207) 评论(0) 推荐(0) 编辑
摘要:"01背包问题" 经典的01背包问题模板 这里提供两种做法: 阅读全文
posted @ 2019-05-09 20:53 Mystery_Sky 阅读(1103) 评论(0) 推荐(0) 编辑
摘要:"最长公共子序列" cpp include include include using namespace std; //Mystery_Sky // define M 1000 string s1, s2; int len1, len2; int f[M][M], ans; int main() 阅读全文
posted @ 2019-05-09 20:51 Mystery_Sky 阅读(544) 评论(0) 推荐(0) 编辑
摘要:"最大子矩阵" 无脑操作题,由于n include using namespace std; //Mystery_Sky // define M 1000 int f[M][M], a[M][M]; int n, ans, maxn; int main() { scanf("%d", &n); fo 阅读全文
posted @ 2019-05-09 19:56 Mystery_Sky 阅读(678) 评论(1) 推荐(1) 编辑
摘要:"最大上升子序列和" "最长上升子序列" 的变式。 状态转移方程: if(ai aj) fi = max(fi, fj+ai) cpp include include using namespace std; //Mystery_Sky // define M 1010 int maxn, n; i 阅读全文
posted @ 2019-05-09 19:39 Mystery_Sky 阅读(436) 评论(0) 推荐(0) 编辑
摘要:"摘花生" 思路与 "最低通行费" 相似 cpp include include include include using namespace std; //Mystery_Sky // define M 1010 int a[M][M], f[M][M]; int t, n, m; int ma 阅读全文
posted @ 2019-05-05 21:25 Mystery_Sky 阅读(294) 评论(0) 推荐(0) 编辑
摘要:"登山" 与 "合唱队形" 只差输出方式,难度较低。 阅读全文
posted @ 2019-05-05 21:17 Mystery_Sky 阅读(562) 评论(0) 推荐(0) 编辑
摘要:"合唱队形" 对于每个点,找到以这个点为终点的最长上升序列长度以及以这个点为起点的最长下降序列长度,找到二者之和最大的点,然后用总人数减去该点二者之和即可。 阅读全文
posted @ 2019-05-05 21:14 Mystery_Sky 阅读(736) 评论(0) 推荐(0) 编辑
摘要:"机器人搬重物" 坑点极多的一道bfs好题! cpp include include include include include using namespace std; //Mystery_Sky // define INF 0x3f3f3f3f const int M = 100; stru 阅读全文
posted @ 2019-05-05 20:32 Mystery_Sky 阅读(139) 评论(0) 推荐(0) 编辑
摘要:题目链接 简单的floyd+剧毒的输入 阅读全文
posted @ 2019-05-01 21:48 Mystery_Sky 阅读(71) 评论(0) 推荐(0) 编辑
摘要:稍作修改的最短路 阅读全文
posted @ 2019-05-01 21:46 Mystery_Sky 阅读(129) 评论(0) 推荐(0) 编辑
摘要:拓扑排序板子题 阅读全文
posted @ 2019-05-01 21:45 Mystery_Sky 阅读(182) 评论(0) 推荐(0) 编辑
摘要:"最低通行费" 由题意可得:第一行所有点只能一直左走走到,所以f[i][j] = a[i][j] + f[i][j 1], 同理第一列的点也只能一直向下走走到,f[i][j] = a[i][j] + f[i 1][j] 。 预处理完后,余下所有点到达该点的最小费用都等于min(到左边的点的最小费用, 阅读全文
posted @ 2019-05-01 21:44 Mystery_Sky 阅读(999) 评论(0) 推荐(0) 编辑
摘要:"最长上升子序列" cpp include include using namespace std; //Mystery_Sky //最长上升子序列 define M 1010 int f[M], a[M], n; int ans; int main() { scanf("%d", &n); for 阅读全文
posted @ 2019-05-01 21:44 Mystery_Sky 阅读(258) 评论(0) 推荐(0) 编辑
摘要:"拦截导弹(Noip1999)" 经典dp题目,这个做法并非最优解,详细参考洛谷 "导弹拦截" ,想想200分的做法。 cpp include include using namespace std; //Mystery_Sky //最长不上升序列+最长不下降序列 define M 1010 int 阅读全文
posted @ 2019-05-01 21:39 Mystery_Sky 阅读(763) 评论(0) 推荐(0) 编辑
摘要:"三角形最佳路径问题" cpp include include using namespace std; //Mystery_Sky //还是 数字金字塔 define M 200 int f[M][M], a[M][M]; int ans, n; int main() { scanf("%d", 阅读全文
posted @ 2019-05-01 21:39 Mystery_Sky 阅读(393) 评论(0) 推荐(0) 编辑
摘要:"求最长不下降序列" 状态转移方程:if(ai aj) fi = max(fi, fj+1) 阅读全文
posted @ 2019-05-01 21:35 Mystery_Sky 阅读(695) 评论(0) 推荐(0) 编辑
摘要:"数字金字塔" 万年dp入门题 cpp include include include using namespace std; //Mystery_Sky // define M 1010 int f[M][M], a[M][M]; int n, ans; int main() { scanf(" 阅读全文
posted @ 2019-05-01 21:34 Mystery_Sky 阅读(491) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示