04 2021 档案

摘要:最大子矩阵问题--悬线法dp problem:搜索全为1的最大子矩阵 #include<bits/stdc++.h> using namespace std; const int N = 2010; const int inf = 1000000007; void in(int &x){ x=0;c 阅读全文
posted @ 2021-04-24 13:59 yesuweiYYYY 阅读(91) 评论(0) 推荐(0)
摘要:tarjan 模板 int low[N],dfn[N],Stack[N],belong[N]; //最小下表,时间戳,一个用数组模拟的栈 //belong[x]表示x所属的强连通分量的编号 int idx,top;//,动态时间戳,栈顶 int scc; //scc表示强连通分量的个数 bool i 阅读全文
posted @ 2021-04-23 08:56 yesuweiYYYY 阅读(71) 评论(0) 推荐(0)
摘要:#include<bits/stdc++.h> using namespace std; struct window{ long long u; bool top; long long cnt; bool operator == (const window &t)const{ return u == 阅读全文
posted @ 2021-04-21 23:34 yesuweiYYYY 阅读(106) 评论(0) 推荐(0)
摘要:Gym324843D 交互,构造。 题意: 在106 * 106的平面中,存在n个点。 你每次询问(x,y) 系统会高呼你一个D,为(x,y)到最近的点的距离的平方。 每当你找到一个点的准确位置以后,当你继续查找时,系统不会再考虑这个点了。 解: 1.随便查询一个点(x,y),得到一个d 2.继续查 阅读全文
posted @ 2021-04-17 20:53 yesuweiYYYY 阅读(65) 评论(0) 推荐(0)
摘要:Gym103049F 注意到任意碰撞只会发生在还存在的两个相邻的石块中。 我们对记录下每一个可能发生碰撞的时间。存入一个优先队列里,队首是最先发生的碰撞。 再使用一个set维护还存在的石头。同时用vis记录一下。 每次弹出队首,一个碰撞,若此碰撞的两石子都存在,那么本碰撞发生,将两个石头从set中删 阅读全文
posted @ 2021-04-17 20:33 yesuweiYYYY 阅读(122) 评论(0) 推荐(0)
摘要:string 容器 常见用法 string s1 = "Hello" string s2("Hello") string s3(s2) string s4 = s3 getline(cin,s)// 从cin中读取一行给s s.empty()// 空?true:false; s.size()//返回 阅读全文
posted @ 2021-04-17 13:30 yesuweiYYYY 阅读(64) 评论(0) 推荐(0)
摘要:SDU 第七周CSP模拟题 A 解:数一下每种颜色袜子的个数,再除以2加到答案里即可 #include <iostream> #include <cmath> using namespace std; const int N = 100010; void in(int &x){ scanf("%d" 阅读全文
posted @ 2021-04-17 12:42 yesuweiYYYY 阅读(139) 评论(0) 推荐(0)
摘要:int sgn(double x){ if (x>eps)return 1; if (x<-eps)return -1; return 0; } struct vec{ double x,y; vec(){x=y=0;} vec(double _x,double _y){x=_x,y=_y;} ve 阅读全文
posted @ 2021-04-09 22:57 yesuweiYYYY 阅读(78) 评论(0) 推荐(0)
摘要:求数组中前k个元素的最大值 class FRISTQUEUE{ public: int k; deque<int>q; deque<int>id; void push(int x,int tid){ while(!q.empty()&&q.back()<x){ q.pop_back(); id.po 阅读全文
posted @ 2021-04-05 13:31 yesuweiYYYY 阅读(54) 评论(0) 推荐(0)