diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2023-03-31 12:23:05 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2023-03-31 12:23:05 +0200 |
commit | 1b055c87170fad129990d04ecbc3cb08b4f7017e (patch) | |
tree | a9681dab0bbbfd33fe9311c0332168678b572c7a /inf/zotksd/3.c | |
parent | vaje10nedok (diff) | |
download | sola-gimb-4-1b055c87170fad129990d04ecbc3cb08b4f7017e.tar sola-gimb-4-1b055c87170fad129990d04ecbc3cb08b4f7017e.tar.gz sola-gimb-4-1b055c87170fad129990d04ecbc3cb08b4f7017e.tar.bz2 sola-gimb-4-1b055c87170fad129990d04ecbc3cb08b4f7017e.tar.lz sola-gimb-4-1b055c87170fad129990d04ecbc3cb08b4f7017e.tar.xz sola-gimb-4-1b055c87170fad129990d04ecbc3cb08b4f7017e.tar.zst sola-gimb-4-1b055c87170fad129990d04ecbc3cb08b4f7017e.zip |
Diffstat (limited to '')
-rw-r--r-- | inf/zotksd/3.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/inf/zotksd/3.c b/inf/zotksd/3.c new file mode 100644 index 0000000..b7723b1 --- /dev/null +++ b/inf/zotksd/3.c @@ -0,0 +1,22 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#define ABS(x) ((x) > 0 ? (x) : -(x)) +#define N unsigned long long int +int main (void) { + char buf[512]; + fgets(buf, 512, stdin); + N n = strtoull(buf, NULL, 10); + N num = 0; + for (N i = 1; i < ceill(sqrtl(n)); i++) { + if (n % i) + continue; + if (ABS(i-n/i) % 2) + continue; + num++; +#ifndef EVAL + fprintf(stderr, "(%llu, %llu)\n", i, n/i); +#endif + } + printf("%llu\n", num); +} |