fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <math.h>
  5. #define N 1000000007
  6. int compare(const void * a, const void * b)
  7. {
  8. return ( *(int*)b - *(int*)a );
  9. }
  10. int main()
  11. {
  12. int T,n,b,x,a,i,j,c,k;
  13. int A[100000]={0};
  14. long long int l,m;
  15. scanf("%d",&T);
  16. for(k=1;k<=T;k++)
  17. { i=0;
  18. scanf("%d %d",&a,&x);
  19. b=pow(2,x);
  20. c=b;
  21. while(b<a){
  22. b=b+c-1;
  23. }
  24. printf("%d\n",b==a);
  25. }
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0s 4172KB
stdin
1
4 2
stdout
1