2
1
Fork 0
aoc2021/06/solution.c
2021-12-06 20:24:38 +01:00

10 lines
346 B
C

#include <stdio.h>
int main(){
#define l(v,e)for(v=0;v<e;v++)
#define P printf("Solution %d: %lu\n",s,c)
size_t F [9]={0},c;int i,I,s=1;while(fscanf
#define C(r) if(i==r){c=0;l(I,9)c+=F[I];P;s++
(stdin,"" "%i%*c", &i)==1) F[i]++;l(i,256)
{F[(i+ 7)%9]+=F[i % 9]; C(79)
;}} C(i);}}