1
0
Fork 0

04: Solve in C

This commit is contained in:
Mia Herkt 2022-12-04 14:54:48 +01:00
parent 83fa5d8bea
commit 4db64c45ca
Signed by: mia
GPG Key ID: 72E154B8622EC191
2 changed files with 1012 additions and 0 deletions

1000
04/input Normal file

File diff suppressed because it is too large Load Diff

12
04/solution.c Normal file
View File

@ -0,0 +1,12 @@
#include <stdio.h>
int main(void) {
int a, b, c, d, S = 0, G = 0;
while (scanf("%d-%d,%d-%d", &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);
}