随笔分类 - luogu_together
摘要:#include <bits/stdc++.h> using namespace std; #define ll long long const int N=1e5+10; int n; ll tree[N<<2],maxn[N<<2]; int Q; void build(int o,int l,
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; #define ll long long struct tree{ll v,late;}t[100010<<2]; int n,m,r,mod,val[100010],p[100010],size[10001
阅读全文
摘要:#include <cstdio> #include <algorithm> using namespace std; const int N=200010; const int INF=1e9; char s[N]; struct Node{ int m[5][5]; Node operator
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N=200010; int lc[N<<5],rc[N<<5],rt[N<<5],sum[N<<5],a[N],b[N],n,m,q,p,sz; void build(int& rt,in
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; int n,m,p,cnt,today,is_guilty[110],may[110]; map<string,int> mp,week; map<int,string> guilty; struct zhe
阅读全文
摘要:#include <cstdio> #include <algorithm> using namespace std; int n,a[5010],f[5010],t[5010],maxn=1,ans; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++
阅读全文
摘要://第二类斯特林数//第二类斯特林数适用于解决球不同,盒子相同,不能有空盒的情况 //我们设f[i][j]表示i个球到j个盒子的方案数//边界:f[0][0]=1//转移:f[i][j]=f[i-1][j]*j+f[i-1][j-1] #include <stdio.h> #include <std
阅读全文
摘要:#include <cstdio> using namespace std; int n,a[500010],ans; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++)scanf("%d",&a[i]); ans=a[1]; for(int i=2;
阅读全文
摘要:两种dp方式 第一种dp[i][j]表示到第i个节点花费j的时间能偷到的最多的画 #include <cstdio> #include <algorithm> using namespace std; int s,a[210],d[210],f[210][6010]; void make_tree(
阅读全文
摘要:#include using namespace std; int n,m,a[30],ans; bool use[30],t[2010]; void dfs(int now,int cnt){ if(now==m){ memset(t,0,sizeof(t)); int sum=0,tot=0; t[0]=1; for(int i=1;i=0;j--)if(t[j] && !...
阅读全文
摘要:#include using namespace std; int n; double x,xx,y,yy,ans,pi=3.141592,t[10]; bool use[10]; struct point{double x,y;}a[10]; double min(double x,double y){return x=y?x:y;} double dist(int x,int y){ ...
阅读全文
摘要:#include using namespace std; double dist,p[10],d[10],v1,c,t,ans,r[10]; int n,now; int min(){ double minn=100000000000; int j; for(int i=0;ip[i])minn=p[i],j=i; return j; } int main(){ ...
阅读全文
摘要:#include using namespace std; int n,m,k,x[510],y[510],f[20010],ans; int main(){ scanf("%d%d%d",&n,&m,&k); for(int i=1;i0 && (i+y[j]-x[j])0 && (y[j]+x[j]-i)<=m && f[y[j]+x[j]-i]!=i){ ...
阅读全文
摘要:#include #include #include #include using namespace std; int n,a[30],b[30],ans; bool use[30]; void search(int now){ if(now>n){ans++; return;} if(!use[a[now]]){ use[a[now]]=true; ...
阅读全文
摘要:#include #include #include using namespace std; const int N=40010; int n,a[N],t[N]; long long ans; inline int read(){ char c; int x=0; c=getchar(); while(!isdigit(c))c=getchar(); ...
阅读全文
摘要:#include #include using namespace std; long long n,k,ans; string m; int main(){ cin>>m>>k; long long x=0,sum=0,y=1; for(int i=0;i=k)break; y*=10; } if(i==1001){printf("...
阅读全文
摘要:#include #include using namespace std; int m,cnt,a[1000000]; int main(){ scanf("%d",&m); while(m>0){ a[++cnt]=(m+1)>>1; m>>=1; } printf("%d\n",cnt); for(int i=c...
阅读全文
摘要:#include #include #define reg register using namespace std; const int N=14; const int S=(1>1&i)); f[0][0]=1; for(reg int i=1;i<=n;i++) for(reg int j=0;j<s;j++) if(g[j] &...
阅读全文
摘要:#include #include #define regint register int using namespace std; long long n,k,p[1000010],cnt,sum[1000010],ans=1e18; long long check(long long n,long long k){ long long cnt=0; for(n/=k;n...
阅读全文
摘要:#include using namespace std; double ans; int n; int main(){ scanf("%d",&n); double ret=420000.00/n; for(register double i=1;i<=n;i++){ ans+=ret; ret-=ret*0.5/i; } ...
阅读全文

浙公网安备 33010602011771号