随笔分类 - ACM
摘要:lower_bound: [l, r)区间内大于等于val的第一个位置 upper_bound: [l, r)区间内大于val的第一个位置 [l, r)区间内小于等于val的第一个位置:upper_bound(l, r, val) - 1 [l, r)区间内小于val的第一个位置:lower_bou
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 8 using namespace std; 9 int n; 10 const int maxn=1e3+2; 11 char str[maxn]; 12 string rel; 13 void handle(){ 14 int l...
阅读全文
摘要:#include #include #include #include #include #include #include using namespace std; int n; string cmd; int now=0; struct node{ int attack; int health; node(int _attack,int _health):attac...
阅读全文
摘要:#include #include #include #include #include using namespace std; const int maxn=1e2+2; char str[maxn]; void line(int l,int r){ int i=l; while(str[i]=='#'||str[i]=='*'||str[i]==' ') i++; ...
阅读全文
摘要:#include #include #include #include #include #include using namespace std; int n,m; const int maxn=82; char str[maxn]; bool flag; map mp; string handle(string fa){ int len=strlen(str); len--...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std; 10 int n,m; 11 const int maxn=1e2+2; 12 string rule[maxn],value[max...
阅读全文
摘要:http://hihocoder.com/problemset/problem/1369?sid=1328132 参考 https://blog.csdn.net/a1799342217/article/details/73195243 https://blog.csdn.net/a51978118
阅读全文
摘要:【AC】 1 #include<iostream> 2 #include<math.h> 3 #include<cstring> 4 5 using namespace std; 6 7 typedef long long LL; 8 9 int N,M; 10 int type,l,r,v; 11
阅读全文
摘要:【60分】 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<string> 5 #include<cmath> 6 #include<algorithm> 7 #include<queue> 8 #incl
阅读全文
摘要:【思路】 dp[i][j]表示前i个数为第j种状态,考虑6种状态 0: 出现且仅出现 2 1: 出现且仅出现 2 0 2: 出现且仅出现 2 3 3: 出现且仅出现 2 0 1 4: 出现且仅出现 2 0 3 5: 出现且仅出现 2 0 1 3 【AC】
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 12 using namespace std; 13 typedef long long ll; 14 const dou...
阅读全文
摘要:【思路】 多个起点同时四周扩展广搜,注意会爆int 【AC】
阅读全文
摘要:#include #include #include #include #include #include using namespace std; const int maxn=2e4+2; const int maxm=2e4+2; const int inf=0x3f3f3f3f; int n,m; struct edge{ int to; int nxt; }e[2*m...
阅读全文
摘要:【题意】 给定一个有向图,问图中互相可达(强连通)的点有多少对 【AC】 强连通缩点,缩点后是一个DAG,所以互相可达的点只在强连通块里。
阅读全文
摘要:#include #include #include #include #include #include #include using namespace std; int n,m; const int maxn=1e4+2; const int maxm=5e4+2; int degree[maxn]; int fa[maxn]; struct edge{ int to; ...
阅读全文
摘要:【题意】 给定有n个点,m条边的无向图,没有平行边和自环,求从1到n的路径中,最长段的最小值(最短路不再是路径和,而是所有段中的最大值) 【AC】
阅读全文
浙公网安备 33010602011771号