- 博客(90)
- 收藏
- 关注
原创 猪国杀
#include <iostream>#include <cstdio>#include <cstring>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=get...
2019-10-10 17:01:32
235
原创 luogu P1948 电话线
#include <iostream>#include <cstdio>#include <queue>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getch...
2019-10-06 16:17:54
178
原创 luogu P1144 最短路计数
#include <iostream>#include <cstdio>#include <queue>using namespace std;int read (){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getc...
2019-10-06 16:16:56
192
原创 A+B problem (网络流)
#include <iostream>#include <cstdio>#include <queue>using namespace std;inline int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if...
2019-05-12 16:56:20
527
原创 luogu P2602 数字计数
数位DP#include <iostream>#include <cstdio>using namespace std;typedef long long LL;const int N=15;LL a,b,o[N],f[N],num[N],ans1[N],ans2[N];LL read(){ LL x=0,f=1; char c=getchar()...
2019-05-11 15:44:03
275
原创 luogu P1352 没有上司的舞会
树形dp遍历树#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(); } ...
2019-05-11 11:22:54
152
原创 luogu P4290 玩具取名
f [ i ] [ j ] [ c ] 表示i到j的字符能否由c转化到#include <iostream>#include <cstdio>#include <map>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0...
2019-05-11 10:43:30
104
原创 luogu P1439 最长公共子序列
按顺序重新赋值最长上升子序列#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(...
2019-05-11 10:41:17
136
原创 luogu P1020 导弹拦截
最长不上升子序列+最长上升子序列#include <iostream>#include <cstdio>using namespace std;const int N=1e5+5,M=5e5+5;int tre[M*4],a[N],n,m=5e5+5,a1,v;void del(int k,int l,int r){ tre[k]=0; if(l==...
2019-05-11 10:39:31
130
原创 luogu P1471 方差
推式子实数读入就别用整数的快读了。。#include <iostream>#include <cstdio>#include <cmath>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c...
2019-05-10 17:11:44
132
原创 luogu P3792 由乃与大母神原型和偶像崇拜
区间哈希+特判#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(); } whi...
2019-05-10 15:39:56
175
原创 luogu P2824 排序
线段树+二分#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(); } whil...
2019-05-10 11:27:31
173
原创 luogu P4513 小白逛公园
#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(); } while(c>='...
2019-05-10 10:54:41
131
原创 luogu P1197 星球大战
离线做相反处理 并查集#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(); }...
2019-05-09 17:27:38
172
原创 luogu P4198 楼房重建
合并状态分情况#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(); } whi...
2019-05-08 17:45:58
232
原创 kmp
#include <iostream>#include <cstdio>#include <cstring>using namespace std;const int N=1e6+5;int n,m,ret[N];char a[N],b[N];int main(){ scanf("%s%s",a,b); n=strlen(a); m...
2019-05-07 15:57:44
242
原创 game
缩点找环#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(); } while(...
2019-05-07 14:30:21
230
原创 sort
线段树求最长上升子序列#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(); }...
2019-05-07 14:29:49
162
原创 聪聪可可
#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(); } while(c>='...
2019-05-07 14:28:44
154
原创 lucky
排列组合#include <iostream>#include <cstdio>#include <map>#define LL long longusing namespace std;int read(bool &f){ f=1; int x=0; char c=getchar(); while(c<'0'||c&g...
2019-05-07 14:27:27
209
原创 tour
单源最短路#include <iostream>#include <cstdio>#include <queue>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; ...
2019-05-07 14:26:38
261
原创 sum
等比数列求和#include <iostream>#include <cstdio>#define LL long longusing namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; ...
2019-05-07 14:25:41
348
原创 树上游戏
#include <iostream>#include <cstdio>#define LL long longusing namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar...
2019-05-07 14:23:35
115
原创 点分治
#include<iostream>#include<cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(); } while(c>='0'...
2019-05-03 17:16:08
83
原创 引水入城
每个蓄水厂覆盖的干旱城市是连续的广搜+一些小处理#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;int read(){ int x=0,f=1; char c=getchar(); ...
2019-04-30 16:43:41
68
原创 油滴扩展
i 和 j !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#include <iostream>#include <cstdio>#include <cmath>using namespace std;int read(){ int x=0,f=1; char c=getchar();...
2019-04-30 14:32:44
134
原创 斐波那契公约数
gcd(f[i],f[j])=f[gcd(i,j)]#include <iostream>#include <cstdio>#define LL long longusing namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { ...
2019-04-30 08:02:21
103
原创 时间复杂度
w可以是两位数#include <iostream>#include <cstdio>#include <cstring>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='n') ret...
2019-04-29 15:29:27
76
原创 独木桥
#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(); } while(c...
2019-04-29 11:31:50
307
原创 均分纸牌
#include <cstdio>#include <iostream>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=g...
2019-04-29 10:38:16
71
原创 能量项链
区间dp#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(); } while(...
2019-04-29 09:46:06
187
原创 金明的预算方案
附件背包#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(); } while(...
2019-04-29 09:00:33
155
原创 花生采摘
巧妙的水题#include <iostream>#include <cstdio>#include <algorithm>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-...
2019-04-28 17:03:02
103
原创 小B的询问
莫队#include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#define LL long long using namespace std;int read(){ int x=0,f=1;...
2019-04-28 09:31:19
113
原创 Luogu P2522 Problem b
反演+容斥#include <iostream>#include <cstdio>#define LL long longusing namespace std;LL read(){ LL x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=...
2019-04-27 15:10:52
75
原创 [POI2007]ZAP-Queries
莫比乌斯反演#include <iostream>#include <cstdio>#define LL long longusing namespace std;LL read(){ LL x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c...
2019-04-27 14:37:52
103
原创 luogu P1147 连续自然数和
一顿乱推出结果#include <iostream>#include <cstdio>#include <cmath>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1;...
2019-04-10 17:28:37
81
原创 luogu P1403 约数研究
1到n中i的倍数有n/i个#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar(); }...
2019-04-10 17:13:37
90
原创 luogu P2257 YY的GCD
莫比乌斯反演为什么long long开多了会TLE QWQ#include <iostream>#include <cstdio>#define LL long longusing namespace std;int read(){ int x=0,f=1; char c=getchar(); while(c<'0'||c>'9')...
2019-04-10 15:43:16
104
原创 luogu P1047 校门外的树O(n)
对于输入的每对l和r,将s[l]加一,s[r+1]减一,然后从0到n扫描,s不断加上a[i],所以s代表当前的i位置被多少条道路覆盖,对于每个i,如果s值为0,那么答案ans就加一#include <iostream>#include <cstdio>using namespace std;int read(){ int x=0,f=1; char c=...
2019-04-10 14:44:43
104
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人