#include<bits/stdc++.h> using namespace std; const int maxn=200; typedef long long ll; const ll mod=998244353; ll pow_m (ll a,ll b,ll mod) { ll res=1; ...
分类:
其他好文 时间:
2020-08-06 20:40:43
阅读次数:
59
Kabaleo Lite 用带负数的大整数用__int128 #include <bits/stdc++.h> #define ll long long using namespace std; const int MAXN=200050,INF=0x3fffffff; ll n,a[MAXN],b ...
分类:
其他好文 时间:
2020-08-04 11:25:20
阅读次数:
327
匈牙利(Hungarian)算法-二分图的最大匹配问题 首先是一个小的讲解视频 上述视频涉及到的一个打卡题目杭电OJ-2063-过山车 我的代码如下:(下面的代码同视频里的稍有不同,或者说是男女正好相反吧) #include<bits/stdc++.h> using namespace std; c ...
分类:
编程语言 时间:
2020-08-03 23:12:35
阅读次数:
63
#include<bits/stdc++.h> using namespace std; const int maxn=200005; struct node{ int a; int b; int c; int cnt; int ans; }s1[maxn],s2[maxn]; int n,m,k, ...
分类:
其他好文 时间:
2020-08-03 09:51:54
阅读次数:
74
换教室 概率期望dp的模板题 状态较好设计,转移的时候注意要把所有的可能性都考虑到并加起来 #include<bits/stdc++.h> #define fi first #define se second #define pb push_back #define mp make_pair #de ...
分类:
其他好文 时间:
2020-07-30 19:42:09
阅读次数:
66
AcWing 143. 最大异或对 /*暴力做法 int res=0; for(int i=0;i<n;i++) //枚举第一个数 for(int j=0;j<i;j++) //枚举第二个数 res=max(res,a[i]^a[j); */ #include <bits/stdc++.h> usi ...
AcWing 240. 食物链 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int n,m; int p[N],d[N]; //find函数返回的是根节点 int find(int x){ if(p[x]!=x) ...
AcWing 838. 堆排序 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int h[N],num; void down(int u){ int t=u; if(u*2<=num&&h[u*2]<h[t]) t ...
分类:
编程语言 时间:
2020-07-30 14:25:51
阅读次数:
68
AcWing 839. 模拟堆 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; // h[N]存储堆中的值, h[1]是堆顶,x的左儿子是2x, 右儿子是2x + 1 // ph[k]存储第k个插入的点在堆中的位置 ...
#include <bits/stdc++.h> #define MAXN 200005 using namespace std; int node,edge,ans=0,k=0; int fat[MAXN],siz[MAXN]; struct EDGE { int from,to,cost; } ...
分类:
编程语言 时间:
2020-07-30 01:20:30
阅读次数:
71