会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
走走
慢慢沉淀...
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
8
9
10
11
12
13
14
15
16
17
下一页
2021年2月10日
单源最短路 : 多起点
摘要: https://www.acwing.com/problem/content/1139/ #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_stdio(false);cin.tie(0); cout.tie
阅读全文
posted @ 2021-02-10 17:00 phr2000
阅读(56)
评论(0)
推荐(0)
2021年2月8日
Hills And Valleys
摘要: http://codeforces.com/contest/1467/problem/B 题意 \(一个数列里有波峰波谷\) \(波谷:a[i]<min(a[i+1],a[i-1]])\) \(波峰:a[i]>max(a[i+1],a[i-1])\) \(sum = 波峰数+波谷数\) \(若可以任
阅读全文
posted @ 2021-02-08 23:10 phr2000
阅读(62)
评论(0)
推荐(0)
2021年2月6日
Fence Painting
摘要: http://codeforces.com/contest/1481/problem/C 题意 \(给n个数,要变成另外n个数,问依次做出m次变换能否成功.\) 思路 \(对于这m个数\) \(如果c[i]不在b中:\) \(如果是最后一个,一定不能成功.\) \(不是最后一个,要考虑它被后面的数覆
阅读全文
posted @ 2021-02-06 22:55 phr2000
阅读(147)
评论(0)
推荐(0)
2021年2月4日
理想正方形
摘要: https://www.acwing.com/problem/content/1093/ \(有一个 a×b 的整数组成的矩阵,现请你从中找出一个 n×n 的正方形区域,使得该区域所有数中的最大值和最小值的差最小。\) 思路 \(分别得到每个n*n正方形中的最小值和最大值\) \(对于每一行做一遍单
阅读全文
posted @ 2021-02-04 23:29 phr2000
阅读(81)
评论(0)
推荐(0)
修建草坪
摘要: https://www.acwing.com/problem/content/description/1089/ 思路 \(单调对列\ + \ dp\) \(不能选超过m个连续的数求最大等价于在每m+1个数中选出最小的一个.\) \(单调队列中维护的f[i-1,\ i-m-1]区间的最小值\) \(
阅读全文
posted @ 2021-02-04 20:55 phr2000
阅读(68)
评论(0)
推荐(0)
滑动窗口
摘要: #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_stdio(false);cin.tie(0); cout.tie(0) inline int lowbit(int x) { return x & (-x
阅读全文
posted @ 2021-02-04 19:41 phr2000
阅读(51)
评论(0)
推荐(0)
绿色通道
摘要: https://www.acwing.com/problem/content/1092/ \(二分\ + \ 单调队列dp\) #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_stdio(false);c
阅读全文
posted @ 2021-02-04 01:58 phr2000
阅读(148)
评论(0)
推荐(0)
烽火传递
摘要: https://www.acwing.com/problem/content/1091/ 状态表示 \(f[i]:点燃第i个且满足且每m个至少点燃一个的全体集合\) \(属性:min\) 状态转移 $f[i] = f[q[hh]]+f[i]\$ #include <bits/stdc++.h> us
阅读全文
posted @ 2021-02-04 01:56 phr2000
阅读(64)
评论(0)
推荐(0)
最大子序和
摘要: https://www.acwing.com/activity/content/problem/content/1458/1/ \(用单调队列得到[i-m,\ i-1]区间中最小的是s[j],\ s[i]-s[j]即为所求\) #include <bits/stdc++.h> using names
阅读全文
posted @ 2021-02-04 01:51 phr2000
阅读(44)
评论(0)
推荐(0)
2021年2月2日
数字游戏Ⅱ
摘要: https://www.acwing.com/problem/content/1086/ \(cpp负数的取模:(-a)\%b (a\%b)\) 状态表示 \(f[i][j][x]:有i位最高位位j且所有位之和对p取模的值为x\) 状态计算 \(f[i][j][x]+=f[i-1][k][mod(x
阅读全文
posted @ 2021-02-02 20:34 phr2000
阅读(59)
评论(0)
推荐(0)
上一页
1
···
8
9
10
11
12
13
14
15
16
17
下一页
公告