摘要: 1. 头文件<algorithm> lower_bound(first,last,val) //在[first,last)区域内查找不小于 val 的第一个元素的地址 upper_bound(first,last,val) //在[first,last)区域内查找大于 val 的第一个元素的地址 2 阅读全文
posted @ 2021-12-04 20:52 Hell0er 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 类似于快读快写 1 inline __int128 read() 2 { 3 __int128 x=0,f=1; 4 char ch=getchar(); 5 while (ch<'0' || ch>'9') 6 { 7 if (ch=='-') f=-1; 8 ch=getchar(); 9 } 阅读全文
posted @ 2021-10-28 21:19 Hell0er 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 1 inline int read() //快读 2 { 3 int x=0,f=1; 4 char ch=getchar(); 5 while (ch<'0' || ch>'9') 6 { 7 if (ch=='-') f=-1; 8 ch=getchar(); 9 } 10 while (ch> 阅读全文
posted @ 2021-10-28 21:18 Hell0er 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <cstdio> 3 using namespace std; 4 5 const int MAXN=50010; 6 int n,k; 7 int head[MAXN]; 8 int re[MAXN]; 9 10 int root( 阅读全文
posted @ 2021-10-28 18:37 Hell0er 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <cstdio> 3 using namespace std; 4 5 const int MAXN=50010; 6 int n,k; 7 int head[MAXN*3]; //一倍存同类,一倍存吃,一倍存被吃 8 9 int r 阅读全文
posted @ 2021-10-27 22:02 Hell0er 阅读(32) 评论(0) 推荐(0) 编辑