标签:ref ati contest def += transform int amp http
#include<cstdio> const int N=1e5+5; int l[N],t[N]; int main(){ int n,L,a,ans=0; scanf("%d%d%d",&n,&L,&a); for(int i=1;i<=n;++i) scanf("%d%d",&t[i],&l[i]); if(l[1]) ans+=t[1]/a; t[n+1]=L; for(int i=1;i<=n;++i) ans+=(t[i+1]-t[i]-l[i])/a; if(!n) ans=L/a; printf("%d",ans); return 0; }
#include<cstdio> char s[1005][1005],c[1005][1005]; int main(){ freopen("b.in","r",stdin); int n,m; scanf("%d%d",&n,&m); for(int i=0;i<n;++i) scanf("%s",s[i]); for(int i=0;i<n;++i) for(int j=0;j<m;++j) c[i][j]=‘.‘; for(int i=0;i+2<n;++i) for(int j=0;j+2<m;++j){ bool sf=1; for(int k=0;k<3&&sf;++k) for(int l=0;l<3&&sf;++l) if(k==1&&l==1) ; else sf=s[i+k][j+l]==‘#‘; if(sf){ for(int k=0;k<3&&sf;++k) for(int l=0;l<3&&sf;++l) if(k==1&&l==1) ; else c[i+k][j+l]=‘#‘; } } for(int i=0;i<n;++i) for(int j=0;j<m;++j) if(s[i][j]!=c[i][j]){ printf("NO"); return 0; } printf("YES"); return 0; }
1059C - Sequence Transformation
#include<cstdio> int main(){ int n; scanf("%d",&n); for(int i=1;n;i<<=1){ if(n==3){ printf("%d %d %d",i,i,3*i); break; } else for(int j=1;j<=(n+1)/2;++j) printf("%d ",i); n/=2; } return 0; }
Codeforces Round #514 (Div. 2)
标签:ref ati contest def += transform int amp http
原文地址:https://www.cnblogs.com/bzmd/p/9746980.html