2019年10月11日
摘要: inline long long fpro(long long x,long long y,long long p) { long long z=(long double)x/p*y; long long res=(unsigned long long)x*y-(unsigned long long)z*p; return (res+p)%p; } inline ... 阅读全文
posted @ 2019-10-11 20:36 thjkhdf12 阅读(126) 评论(0) 推荐(0)
摘要: 1 #include<iostream> 2 #include<string> 3 #include<queue> 4 #include<stack> 5 #include<vector> 6 #include<map> 7 #include<cstdio> 8 #include<cstdlib> 阅读全文
posted @ 2019-10-11 20:25 thjkhdf12 阅读(106) 评论(0) 推荐(0)
摘要: 1 #include<iostream> 2 #include<string> 3 #include<queue> 4 #include<stack> 5 #include<vector> 6 #include<map> 7 #include<cstdio> 8 #include<cstdlib> 阅读全文
posted @ 2019-10-11 14:36 thjkhdf12 阅读(137) 评论(0) 推荐(0)
摘要: int n; const int maxn = 100010; int a[maxn]; int sum1[maxn]; int sum2[maxn]; inline int lowbit(int x) { return x & (-x); } inline void updata(int i, int k) { int x = i; while (i <= n) { sum1[i] += k; 阅读全文
posted @ 2019-10-11 13:30 thjkhdf12 阅读(128) 评论(0) 推荐(0)
摘要: const int maxn = 5000010; int a[maxn]; #define lc(x) x<<1 #define rc(x) x<<1|1 il int min(int a, int b) { return a > b ? b : a; } struct tree { int a; 阅读全文
posted @ 2019-10-11 13:06 thjkhdf12 阅读(160) 评论(0) 推荐(0)
  2019年10月9日
摘要: int cnt; struct Edge { int v, nxt; //int w; }e[maxn]; int head[maxn]; inline void init() { memset(head, -1, sizeof(head)); } void add(int u, int v/*,i 阅读全文
posted @ 2019-10-09 17:40 thjkhdf12 阅读(109) 评论(0) 推荐(0)
摘要: #include<iostream> #include<string> #include<queue> #include<stack> #include<vector> #include<map> #include<cstdio> #include<cstdlib> #include<algorit 阅读全文
posted @ 2019-10-09 17:35 thjkhdf12 阅读(166) 评论(0) 推荐(0)
摘要: 1 const int maxn = 100010; 2 int fa[maxn]; 3 4 int find(int x) 5 { 6 if (fa[x] == x) return x; 7 fa[x] = find(fa[x]); 8 return fa[x]; 9 } 10 11 void merge(int a, int b) 12 { 13... 阅读全文
posted @ 2019-10-09 13:59 thjkhdf12 阅读(95) 评论(0) 推荐(0)
摘要: 1 #include<iostream> 2 using namespace std; 3 4 int n, m; 5 int a[10010], b[10010], c[10010]; 6 int x[10010]; 7 8 int main() 9 { 10 cin >> n >> m; 11 阅读全文
posted @ 2019-10-09 13:55 thjkhdf12 阅读(98) 评论(0) 推荐(0)
摘要: 1 #include<iostream> 2 #include<queue> 3 using namespace std; 4 5 #define debug(a) cout<<"debug: "<<a<<endl 6 7 struct Pro 8 { 9 int num, re, us, le; 阅读全文
posted @ 2019-10-09 13:54 thjkhdf12 阅读(98) 评论(0) 推荐(0)