blob: 5c39b3ca83b6effdd543f4e34924fc6bed31fa03 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
size_t n;
scanf("%zu", &n);
double t, *weights = malloc(n * sizeof(double));
scanf("%lf", &t);
for (size_t i = 0; i < n; ++i)
scanf("%lf", weights + i);
int tmp;
for (size_t i = 0; i < n; ++i) {
scanf("%d", &tmp);
t -= tmp && weights[i];
}
putchar((t <= 0) + 48);
putchar(10);
return 0;
}
|