Advertisement
erfanul007

Timus 1209

Dec 26th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. long long int n,k,i,j,x,sq,r;
  5. scanf("%lld",&n);
  6. for(i=1;i<=n;i++){
  7. scanf("%lld",&k);
  8. x=(k-1)*2;
  9. sq=sqrt(x);
  10. r=sq*(sq+1);
  11. if(r==x)
  12. printf("1");
  13. else
  14. printf("0");
  15. if(i==n)
  16. printf("\n");
  17. else
  18. printf(" ");
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement