随笔分类 -  模板

摘要:模板题,但码量大。本题主要考察的是存图的方式。 图的类别 有向图:简单来说是指一副具有方向性的图。例如节点 \(a\) 指向节点 \(b\) ,则只能从 \(a\) 走到 \(b\),而不能从 \(b\) 走到 \(a\)。 无向图:若一个图中每条边都是无方向的,则称为无向图。如果一个图为无向图,则 阅读全文
posted @ 2024-06-11 20:42 Arthur_Douglas 阅读(17) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> #define int long long #define MAXN 500010 using namespace std; struct edge { int nxt,to; }; edge e[MAXN*2]; int h[MAXN],ei; v 阅读全文
posted @ 2024-05-20 22:30 Arthur_Douglas 阅读(5) 评论(0) 推荐(0) 编辑
摘要:不加弧优化 #include <bits/stdc++.h> #define int long long using namespace std; const int N = 10005; int n, m, s, t; struct edge {int v, nxt, val;} e[N * 2] 阅读全文
posted @ 2024-02-22 12:10 Arthur_Douglas 阅读(9) 评论(0) 推荐(0) 编辑
摘要:void pushup(int tr){ seg[tr]=seg[tr*2]+seg[tr*2+1]; } void build(int tr,int l,int r){ if(l==r){ seg[tr]=a[r]; return ; } int mid=(l+r)/2; build(tr/2,l 阅读全文
posted @ 2024-01-28 13:36 Arthur_Douglas 阅读(12) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define int long long using namespace std; int len,n,a[100009],g[100009]; signed main(){ scanf("%ld",&n); for(int i=1;i<=n;i++ 阅读全文
posted @ 2024-01-27 15:49 Arthur_Douglas 阅读(8) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define int long long using namespace std; int n,m,x,x1,y,z; int a[100010],d[100010],c[100010]; int lowbit(int num){return num 阅读全文
posted @ 2024-01-26 17:08 Arthur_Douglas 阅读(8) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define int long long using namespace std; const int Max = 500005; int a[Max]; int n,m; int lowbit(int x) { return x & -x; } v 阅读全文
posted @ 2024-01-25 10:47 Arthur_Douglas 阅读(6) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> using namespace std; struct node1{int l,r,value;}; node1 node[100010]; > node是村树的数组 int a[100010]; > a是输入数组 inline void mt(int 阅读全文
posted @ 2024-01-25 10:47 Arthur_Douglas 阅读(7) 评论(0) 推荐(0) 编辑
摘要:part1 #include<bits/stdc++.h> #define int long long using namespace std; struct node1{int l,r,value;}; node1 node[2000020]; int a[500010]; void mt(int 阅读全文
posted @ 2024-01-25 10:46 Arthur_Douglas 阅读(6) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> #define int long long #define MAXM 200010 #define MAXN 100010 using namespace std; struct edge { int next,to,v; } e[MAXM]; in 阅读全文
posted @ 2024-01-25 10:45 Arthur_Douglas 阅读(12) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> using namespace std; int n,m,ans=1,ans1=0,f[100001]; struct node { int x,y,t; } a[1000010]; int cmp(node x,node y) { if(x.t<y. 阅读全文
posted @ 2024-01-25 10:45 Arthur_Douglas 阅读(16) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> using namespace std; int a[110][110],b[110][110],c[110][110],m,n,k; double s; int main() { cin>>n>>m>>k; for(int i=1;i<=n;i++) 阅读全文
posted @ 2024-01-25 10:44 Arthur_Douglas 阅读(6) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define int long long using namespace std; int n,k,m=1e9 + 7,c[1010][1010],a[1010][1010],a1[1010][1010],x[1010][1010]; void fi 阅读全文
posted @ 2024-01-25 10:44 Arthur_Douglas 阅读(5) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define int long long using namespace std; int n,a[1000009]; inline void read(register int &a) { a=0;char c; while((c=getchar( 阅读全文
posted @ 2024-01-25 10:41 Arthur_Douglas 阅读(8) 评论(0) 推荐(0) 编辑