Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int t,num,i;
- long long sum;
- scanf("%d",&t);
- for(i=0;i<t;i++){
- scanf("%d",&num);
- sum=(long long)sqrt((unsigned int)(num-1)*2);
- sum=sum*(sum+1)/2+1;
- if(sum==num)printf("1");
- else printf("0");
- if(i!=t-1)
- printf(" ");
- }
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement