随笔分类 -  模板

摘要:```cpp include include include include include include include include include include include include include using namespace std; const int maxN=100 阅读全文
posted @ 2019-07-16 13:12 prestige 阅读(103) 评论(0) 推荐(0)
摘要:```cpp //kosaraju #include #include #include #include #include #include #include using namespace std; const int N=10005; int n,m,cnt,head[N],rhead[N],t,rt,q[N],top,ans,rcnt,Cnt[N],sum[N],number; bool ... 阅读全文
posted @ 2019-07-16 13:11 prestige 阅读(144) 评论(0) 推荐(0)
摘要:```cpp include include include include include include include using namespace std; const int N=50005; int n,m,head[N],dfs[N],stack[N],low[N],cnt,t,to 阅读全文
posted @ 2019-07-16 13:10 prestige 阅读(104) 评论(0) 推荐(0)
摘要:```cpp include include include include include include include using namespace std; const int N=10005; int n,m,cnt,rcnt,head[N],rhead[N],t,rt,ans; boo 阅读全文
posted @ 2019-07-16 13:09 prestige 阅读(158) 评论(0) 推荐(0)
摘要:树状数组求逆序对 cpp include include include include include include include using namespace std; const long long N=1000005; long long t,n,aa[N],c[N],i,ans; s 阅读全文
posted @ 2019-07-16 13:08 prestige 阅读(136) 评论(0) 推荐(1)
摘要: 阅读全文
posted @ 2019-07-16 13:00 prestige 阅读(92) 评论(0) 推荐(0)
摘要:```cpp include using namespace std; const int N = 100005; int ch[N][2], par[N], val[N], cnt[N], size[N], rev[N], root, ncnt; int n, m, x, y; bool chk( 阅读全文
posted @ 2019-07-16 12:41 prestige 阅读(154) 评论(0) 推荐(0)
摘要:```cpp include include include include include include include using namespace std; const int N=1000005,M=25; int n,m,a[N],f[N][M]; int query(int L,in 阅读全文
posted @ 2019-07-16 12:34 prestige 阅读(119) 评论(0) 推荐(0)
摘要:```cpp 【题目描述】: 有 N 个盘子,每个盘子上写着一个仅由小写字母组成的英文单词。你需要给这些盘子安排一个合适的顺序,使得相邻两个盘子中,前一个盘子上单词的末字母等于后一个盘子上单词的首字母。请你编写一个程序,判断是否能达到这一要求。如果能,请给出一个合适的顺序。 【输入描述】: 多组数据。第一行给出数据组数T,每组数据第一行给出盘子数量N,接下去N行给出小写字母字符串,一种字符串... 阅读全文
posted @ 2019-07-15 13:51 prestige 阅读(281) 评论(0) 推荐(0)
摘要:```cpp include include include include include include include include using namespace std; const int N=2005; int n,a,b,G[N][N],d[N],ans[N],Cnt; void 阅读全文
posted @ 2019-07-15 12:53 prestige 阅读(913) 评论(0) 推荐(0)
摘要:```cpp #include #include #include using namespace std; int n; int a[101][101]; int indegree[101]; int outdegree[101]; int bfs(); int ans[101][101]; int compare(); void print(int i); int ma... 阅读全文
posted @ 2019-07-15 12:02 prestige 阅读(825) 评论(0) 推荐(0)
摘要:```cpp include include include using namespace std; const int maxn=1002; vector graph[maxn]; int n,m,cnt,in; bool visited[maxn]; void dfs(int v) { for 阅读全文
posted @ 2019-07-15 12:01 prestige 阅读(531) 评论(0) 推荐(0)
摘要:```cpp // luogu judger enable o2 include include include include include include include using namespace std; const int N=100005; int n,m,u1,v1,Cnt,fa 阅读全文
posted @ 2019-07-14 16:17 prestige 阅读(85) 评论(0) 推荐(0)
摘要:题面:https://www.luogu.org/problemnew/show/P4549 cpp 裴蜀定理:ax+by=c,x∈Z∗,y∈Z∗成立的充要条件是gcd⁡(a,b)∣c。Z∗表示正整数集。 Code: include include include include using nam 阅读全文
posted @ 2019-07-14 16:14 prestige 阅读(159) 评论(0) 推荐(0)