-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathid0053.c
More file actions
38 lines (28 loc) · 667 Bytes
/
id0053.c
File metadata and controls
38 lines (28 loc) · 667 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Licensed under the MIT License.
// Combinatoric Selections
#include "../lib/binomial.h"
#include "../lib/euler.h"
int main(void)
{
int count = 0;
clock_t start = clock();
for (int n = 1; n <= 100; n++)
{
long long* binomials = mod_binomial_range(n + 1, 0);
euler_assert(binomials);
for (int r = 1; r <= n; r++)
{
int k = r;
if (k > n - k)
{
k = n - k;
}
if (binomials[k] > 1000000l)
{
count++;
}
}
free(binomials);
}
return euler_submit(53, count, start);
}