Main topic:
Δ (n) represents the and of all the factors of n, given a number n, the number of x between [1,n], which satisfies δ (x) is the number of an even x.
Problem Solving Ideas:
Want to go, no train of thought, only feel and 2 this factor is related, see everyone has made, feel the topic should not be too difficult, so hit the mark looked, found only 2x,x2,2*x2 factor is not even, just to calculate out then subtract duplicate of OK:
2x/x2: Can be converted, and when X is even, the two repeats.
2X/2*X2: When x is odd, the two repeats.
So the final result is n minus the number of X2 and 2*x2.
Code:
1#include <cstdio>2#include <cstring>3#include <iostream>4#include <algorithm>5#include <cmath>6 using namespacestd;7 8 intMain ()9 {Ten Long LongT, N, L =1; Onescanf ("%lld", &t); A while(T--) - { -scanf ("%lld", &n); the Long LongT1, T2; -T1 = (Long Long) sqrt (n);//Number of x^2 -T2 = (Long Long) sqrt (n/2);//Number of 2*x^2 -printf ("Case %lld:%lld\n", l++, N-t1-T2); + } - return 0; +}
Lightoj 1336 Sigma Function