1
0
Fork 0
aoc2022/04/solution.c
2022-12-05 18:48:24 +01:00

12 lines
291 B
C

#include <stdio.h>
int main(void) {
int a, b, c, d, S = 0, G = 0;
while (scanf("%u-%u,%u-%u", &a, &b, &c, &d) == 4) {
S += (a >= c && b <= d) || (c >= a && d <= b);
G += (a <= c && b >= c) || (c <= a && d >= a);
}
printf("Silver: %d\nGold: %d\n", S, G);
}