You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
309 B

#include <input.h>
__attribute__((pure))
uint64_t chk_pair(const struct ipair* restrict pair)
{
return pair->prev < pair->next;
}
int part1(uint64_t* restrict _res)
{
uint64_t res = 0;
for(size_t i=0;i<INPUT_SIZE-1;i++)
{
res += chk_pair((const struct ipair*)(INPUT+i));
}
*_res = res;
return 0;
}