随笔分类 -  DP

摘要:div3真好啊 养老 A. Boring Apartments 直接模拟 B. Yet Another Bookshelf 模拟 C. Dominant Piranha 不会 D. Districts Connection 模拟,按树每个deep去分层连就行了 #include<bits/stdc+ 阅读全文
posted @ 2020-10-21 10:41 摸鱼选手LLF 阅读(235) 评论(0) 推荐(1)
摘要:http://codeforces.com/contest/1422/problem/D D. Returning Home 一个n*n的图 有些点就是可以瞬移 和象棋里车的规则一样,给你一些点,只要你在横纵坐标 就可以瞬移过去 考虑对x,y的列和行建图就可以了 #include <bits/std 阅读全文
posted @ 2020-10-13 10:47 摸鱼选手LLF 阅读(123) 评论(0) 推荐(0)
摘要:区间DP 不多说了 和上面那个题一样 还是日常DFS写DP 不会循环 #include<bits/stdc++.h> #define fi first #define se second #define io std::ios::sync_with_stdio(false) using namesp 阅读全文
posted @ 2020-09-29 19:17 摸鱼选手LLF 阅读(175) 评论(0) 推荐(0)
摘要:区间合并石子 每次合并相邻的两堆,求最大和最小能获得的值 cao。。一开始直接排序然后贪心,想了半天不知道哪里错了,原来是我眼瞎了抱歉 然后区间DP一下 不会写循环 DP只会写搜索 嘻嘻 #include<bits/stdc++.h> #define fi first #define se seco 阅读全文
posted @ 2020-09-29 18:59 摸鱼选手LLF 阅读(231) 评论(0) 推荐(0)