1059a-cashier
#include <cstdio>Const intn=1e5+5;intL[n],t[n];intMain () {intn,l,a,ans=0; scanf ("%d%d%d",&n,&l,&a); for(intI=1; i<=n;++i) scanf ("%d%d",&t[i],&L[i]); if(l[1]) ans+=t[1]/A; T[n+1]=L; for(intI=1; i<=n;++i) ans+ = (t[i+1]-t[i]-l[i])/A; if(!n) ans=l/A; printf ("%d", ans); return 0;}
1059b-forgery
#include <cstdio>Chars[1005][1005],c[1005][1005];intMain () {Freopen ("b.in","R", stdin); intn,m; scanf ("%d%d",&n,&m); for(intI=0; i<n;++i) scanf ("%s", S[i]); for(intI=0; i<n;++i) for(intj=0; j<m;++j) C[i][j]='.'; for(intI=0; i+2<n;++i) for(intj=0; j+2<m;++j) { BOOLsf=1; for(intk=0;k<3&&sf;++k) for(intL=0;l<3&&sf;++l)if(k==1&&l==1) ; Elsesf=s[i+k][j+l]=='#'; if(SF) { for(intk=0;k<3&&sf;++k) for(intL=0;l<3&&sf;++l)if(k==1&&l==1) ; Elsec[i+k][j+l]='#'; } } for(intI=0; i<n;++i) for(intj=0; j<m;++j)if(s[i][j]!=C[i][j]) {printf ("NO"); return 0; } printf ("YES"); return 0;}
1059c-sequence transformation
#include <cstdio>intMain () {intN; scanf ("%d",&N); for(intI=1; n;i<<=1){ if(n==3) {printf (" %d%d%d", I,i,3*i); Break; } Else for(intj=1; J<= (n+1)/2; ++j) printf ("%d", i); N/=2; } return 0;}
Codeforces Round #514 (Div. 2)