• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






Baudelaire

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2021年4月8日

饥饿的奶牛(算是模板题了,求给出N段区间的最大长度和,且区间不能有重叠)
摘要: //思路,看成一块一块的草块,一格一格遍历,从左到右//状态转移方程f[j]=max(f[j],f[i]+j-i+1);#include <bits/stdc++.h> using namespace std; #define ll long long const int M = 3e6 + 1; 阅读全文
posted @ 2021-04-08 22:52 Baudelaire 阅读(89) 评论(0) 推荐(0)
 
P1091 [NOIP2004 提高组] 合唱队形(求升序序列的N^2复杂度的模板)
摘要: #include <bits/stdc++.h> using namespace std; #define ll long long const int M = 1e5 + 1; int a[M]; int f[3][M]; int main() { int n; cin >> n; for (in 阅读全文
posted @ 2021-04-08 21:30 Baudelaire 阅读(67) 评论(0) 推荐(0)
 
P1020 [NOIP1999 普及组] 导弹拦截(此题的时间复杂度为N*LOGN,求最长的(上升或下降)序列)应作为模板使用
摘要: 这道题,没理解透彻,对于题解中,查找最长升序序列,和最长降序序列的方法还没完全理解题目就是找一个最长升序序列,为至少要的导弹拦截布置数,降序序列为最多的拦截导弹数#include <bits/stdc++.h> using namespace std; #define ll long long co 阅读全文
posted @ 2021-04-08 19:31 Baudelaire 阅读(81) 评论(0) 推荐(0)
 
P1294 高手去散步 (基础模板)(DFS,搜索最长路的模板,也可以改成搜索最短路)
摘要: #include <iostream> #include <set> #include <vector> #include <cmath> #include <cstdio> #include <cstring> #include <algorithm> #include <queue> #incl 阅读全文
posted @ 2021-04-08 19:29 Baudelaire 阅读(79) 评论(0) 推荐(0)
 
P1020 [NOIP1999 普及组] 导弹拦截(此题的时间复杂度为n*logn,求最长的(上升或下降)序列)应作为模板使用
摘要: 这道题,没理解透彻,对于题解中,查找最长升序序列,和最长降序序列的方法还没完全理解题目就是找一个最长升序序列,为至少要的导弹拦截布置数,降序序列为最多的拦截导弹数#include <bits/stdc++.h> using namespace std; #define ll long long co 阅读全文
posted @ 2021-04-08 19:26 Baudelaire 阅读(315) 评论(0) 推荐(0)
 
2019, XII Samara Regional Intercollegiate Programming Contest. ()
摘要: 这场比赛,我写的跟个憨批一样,日常全靠队友 A题 //一开始写了个正向的,用memset每次都把它全都置0,tle16//后来用vector记录哪几个数用了,tle27//所以,以后正向遍历不行,就要思考反向的#include <bits/stdc++.h> using namespace std; 阅读全文
posted @ 2021-04-08 15:14 Baudelaire 阅读(289) 评论(0) 推荐(0)
 

2021年4月6日

数字三角形
摘要: #include <bits/stdc++.h> using namespace std; #define ll long long const int M = 1e3 + 1; int dp[M][M]; int a[M][M]; int main() { int n; cin >> n; for 阅读全文
posted @ 2021-04-06 20:11 Baudelaire 阅读(68) 评论(0) 推荐(0)
 
滑雪问题,记忆化搜索
摘要: #include <bits/stdc++.h> using namespace std; #define ll long long const int M=1e3+1; const int dx[4]={1,0,-1,0};//存方向移动 const int dy[4]={0,1,0,-1}; i 阅读全文
posted @ 2021-04-06 19:28 Baudelaire 阅读(62) 评论(0) 推荐(0)
 

2021年4月3日

P5194 [USACO05DEC]Scales S(这个剪枝还没看懂
摘要: #include <iostream> #include <algorithm> //所以说题目中的第三个砝码以及之后的砝码必是前面两个砝码之和之大为前置条件 //没必要自己弄 using namespace std; const int M = 1e3 + 1; long long sum[M], 阅读全文
posted @ 2021-04-03 15:45 Baudelaire 阅读(97) 评论(0) 推荐(0)
 
UVA572 油田 Oil Deposits(BFS复习)
摘要: #include <iostream> #include <set> #include <vector> #include <cmath> #include <cstdio> #include <cstring> #include <algorithm> #include <queue> #defi 阅读全文
posted @ 2021-04-03 14:29 Baudelaire 阅读(75) 评论(0) 推荐(0)
 
下一页