I have 16GB of RAM and this code
#include <stdio.h>
#define len 900000000
int phi[len];
int main() {
for (int i = 2; i < len; i++) {
phi[i] = i - 1;
}
phi[0] = 0;
phi[1] = 1;
for (int i = 2; i < len; i++) {
for (int j = 2 * i; j < len; j += i) {
phi[j] -= phi[i];
}
}
return 0;
}
this code does not compile
error: unknown type size
Is there anything that can be done to make it compile without rewriting the code? I work on Windows 10.
You need to sign in to view this answers