上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 45 下一页
该文被密码保护。 阅读全文
posted @ 2020-11-09 12:24 Gold_stein 阅读(0) 评论(0) 推荐(0)
摘要: 对于一个区间,要么一次全部删除,要么先删除左边,再删除右边 #include<bits/stdc++.h> using namespace std; const int N=110; int n,f[N][N]; int main() { scanf("%d",&n); for(int i=1;i< 阅读全文
posted @ 2020-08-28 10:45 Gold_stein 阅读(170) 评论(0) 推荐(1)
摘要: RT 阅读全文
posted @ 2020-08-23 16:00 Gold_stein 阅读(109) 评论(0) 推荐(0)
摘要: STL优先队列写法 #include<bits/stdc++.h> using namespace std; const int N=1e5+5; int n,ne[N]; struct node{ int val,pos; bool operator < (const node &G) const 阅读全文
posted @ 2020-08-23 09:18 Gold_stein 阅读(179) 评论(0) 推荐(0)
摘要: vector<int> alls; // 存储所有待离散化的值 sort(alls.begin(), alls.end()); // 将所有值排序 alls.erase(unique(alls.begin(), alls.end()), alls.end()); // 去掉重复元素 // 二分求出x 阅读全文
posted @ 2020-08-21 14:36 Gold_stein 阅读(174) 评论(0) 推荐(0)
摘要: http://noip.ybtoj.com.cn/contest/19/problem/3 这道题仍然可以用例题逃离噩梦的思路来解决。 #include<bits/stdc++.h> #define x first #define y second using namespace std; type 阅读全文
posted @ 2020-08-17 00:12 Gold_stein 阅读(418) 评论(0) 推荐(0)
摘要: 这道题的难点在于如何判断在某个时刻巨龙能否打中猎物,如果每一次巨龙走完都要check一次效率太低,而注意到猎物是不动的,我们可以初始化出能打中猎物的点,只要巨龙移动到这些位置,就完成搜索。 #include<bits/stdc++.h> #define x first #define y secon 阅读全文
posted @ 2020-08-17 00:04 Gold_stein 阅读(323) 评论(0) 推荐(0)
摘要: 这道题的数据是不是有点水?还是题目描述有问题? #include<bits/stdc++.h> #define x first #define y second using namespace std; const int N=1005; typedef pair<int,int> PII; int 阅读全文
posted @ 2020-08-15 08:56 Gold_stein 阅读(244) 评论(0) 推荐(0)
摘要: 啊 这是网络流24T中的一题,可是那玩意儿我没学 那就DP吧 状态转移方程很容易得到 但这道题并不是往前走就完事儿了,即这道题的状态转移是有后效性的,不能用普通的循环来DP。 即这道题的状态转化成一个图以后,不是拓扑图。 这时候就需要用最短路算法来DP(其实DP都可以用图论的算法来处理,不过因为通常 阅读全文
posted @ 2020-08-14 15:14 Gold_stein 阅读(164) 评论(0) 推荐(0)
摘要: 这道题书上写错了,Dijkstra算法在这道题的情景当中的正确性是无法保证的。 #include<bits/stdc++.h> using namespace std; const int N=100010,M=2000005; int n,m; int dmin[N],dmax[N]; int h 阅读全文
posted @ 2020-08-14 10:45 Gold_stein 阅读(203) 评论(0) 推荐(0)
上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 45 下一页