Guest User

Untitled

a guest
Sep 15th, 2020
34
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<cstdio>
  2. #include<cstdlib>
  3. #define K 400
  4. #define L K
  5. #define M (i*)malloc(32)
  6. #define a(C,X,Y)C&&b[Y][X].c?t->n=M,t=t->n,b[Y][X].d=d+1,t->n=0,t->c=X,t->d=Y:0,
  7. #define F fgetc(f)
  8. #define W(A,B)for(A=0;A<B;A++){
  9. struct i{int c,d,v;i*n;}b[L][K],*h,*t,*p;float m;int x,y,d;int main(){FILE*f=fopen("d","r+b");W(y,L)W(x,K)b[y][x].c=F<<16|F<<8|F;}}rewind(f);t=h=M;for(b[h->d=y=155][h->c=x=165].d=d;h;){p=b[h->d]+h->c;p->v?h=h->n,0:(p->v=1,x=h->c,y=h->d,d=p->d,m=d>m?d:m,a(x>0,x-1,y)a(x<K-1,x+1,y)a(y>0,x,y-1)a(y<L-1,x,y+1)0);}W(y,L)W(x,K)i p=b[y][x];unsigned char n=-1,h=p.d/(m/n),R=h%43*6,Q=n*(n-(n*R>>8))>>8,t=n*(n-(n*(n-R)>>8))>>8,r=0,g=0,b=0,Z=h/43;Z-5?Z-4?Z-3?Z-2?Z-1?Z?:(r=n,g=t):(r=Q,g=n):(g=n,b=t):(g=Q,b=n):(r=t,b=n):(r=n,b=Q);d=h?r|g<<8|b<<16:p.c?-1:0;fwrite(&d,1,3,f);}}}
RAW Paste Data