随笔分类 -  / 算法

摘要:最后还是照着题解A了这道题…… #include <bits/stdc++.h> using namespace std; int n,m,s,t,edge_sum=1; int maxflow,mincost; int dis[5005],head[5005],incf[5005],pre[500 阅读全文
posted @ 2024-10-22 13:23 yzc_is_SadBee 阅读(11) 评论(0) 推荐(0)
摘要:oh dear #include<bits/stdc++.h> using namespace std; int n,k,m,s,t,a[105][105],wen[105]; int d[100005]; bool vis[100005]; int qi,mo,f; inline int read 阅读全文
posted @ 2024-10-22 11:39 yzc_is_SadBee 阅读(11) 评论(0) 推荐(0)
摘要:酷狗没会员了QAQ #include<bits/stdc++.h> using namespace std; int n,m,f[1001],enm[1001]; int find(int x) { if(f[x]!=x) x=find(f[x]); return x; } void hebing( 阅读全文
posted @ 2024-10-22 11:16 yzc_is_SadBee 阅读(10) 评论(0) 推荐(0)
摘要:然而题单里就是有这题…… dij,照亮世界! #include<bits/stdc++.h> using namespace std; int n,k,m,s,t,a[105][105],wen[105]; int d[100005]; bool vis[100005]; int qi,mo,f; 阅读全文
posted @ 2024-10-21 08:34 yzc_is_SadBee 阅读(9) 评论(0) 推荐(0)
摘要:暴搜+剪枝。 #include<bits/stdc++.h> using namespace std; struct f{ int rank,sum; }cou[10]; int a[10][10],hang[10][10],lie[10][10],gong[10][10],s[100][4],u, 阅读全文
posted @ 2024-10-21 08:06 yzc_is_SadBee 阅读(16) 评论(0) 推荐(0)
摘要:这题治好了我的快读恐惧症,让我理解了cin的力量 cin,照亮世界! #include<bits/stdc++.h> using namespace std; const int inf=0x3f3f3f3f; int n,ans=-inf; int a[105]; int f[150][150], 阅读全文
posted @ 2024-10-16 19:43 yzc_is_SadBee 阅读(13) 评论(0) 推荐(0)
摘要:怎么这么多忘交的 一起发的原因还是vjudge #include<bits/stdc++.h> using namespace std; int read() { int x = 0; bool op = 0; char c = getchar(); while(!isdigit(c))op |= 阅读全文
posted @ 2024-10-15 20:18 yzc_is_SadBee 阅读(25) 评论(0) 推荐(0)
摘要:唐 #include<bits/stdc++.h> #define U(i,l,r) for(int i(l);i<=r;++i) #define D(i,r,l) for(int i(r);i>=l;--i) #define Huge_Int vector<long long> #define B 阅读全文
posted @ 2024-10-15 20:02 yzc_is_SadBee 阅读(26) 评论(0) 推荐(0)
摘要:水题,一起切了 #include<bits/stdc++.h> using namespace std; int a[5000010]; int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,k; cin>>n>>k; 阅读全文
posted @ 2024-10-14 20:20 yzc_is_SadBee 阅读(11) 评论(0) 推荐(0)
摘要:st表。(还是半懂不懂) #include <bits/stdc++.h> using namespace std; int n,m,x,y,l,a[100010],f[100010][20]; int main(){ cin>>n>>m; a[1]=0; for(int i=2;i<=n;i++) 阅读全文
posted @ 2024-10-14 20:20 yzc_is_SadBee 阅读(9) 评论(0) 推荐(0)
摘要:区间dp。 转移方程见题解(doge) #include<bits/stdc++.h> using namespace std; int m[310],dp[310][310],ans; int main() { ios::sync_with_stdio(0); cin.tie(NULL); cou 阅读全文
posted @ 2024-10-11 20:36 yzc_is_SadBee 阅读(18) 评论(0) 推荐(0)