I am doing a problem about http://acm.hnu.cn:8080/online/?actio...=show&id=10238

I have uploaded it for many time but get WRONG ANSWER. So I hope someone can help me. This is my solution below. (input K_i < 2^31 =2147483648)

Code:#include <stdio.h> #include <math.h> int main() { int i, n; long long x, k; scanf("%d", &n); for (i = 1; i <= n; i++) { scanf("%lld", &x); k = 8*x-7; if ((sqrt(k) == (int)sqrt(k)) && ((int)sqrt(k) % 2 != 0)) if (i < n) printf("1 "); else printf("1"); else if (i < n) printf("0 "); else printf("0"); } printf("\n"); return 0; }