2
1
Fork 0
aoc2021/06/solution.c

11 lines
346 B
C
Raw Permalink Normal View History

2021-12-06 19:00:35 +01:00
#include <stdio.h>
2021-12-06 19:21:40 +01:00
2021-12-06 20:15:25 +01:00
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);}}