daily pastebin goal
57%
SHARE
TWEET

Untitled

a guest Mar 26th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long ll;
  5.  
  6. #define sc1(a) scanf("%lld",&a)
  7. #define sc2(a,b) scanf("%lld %lld",&a,&b)
  8.  
  9. #define pf1(a) printf("%lld\n",a)
  10. #define pf2(a,b) printf("%lld %lld\n",a,b)
  11.  
  12. #define mx 10000000000
  13. #define mod 10000007
  14.  
  15. map<ll, bool>mp;
  16. map<ll, bool>::iterator it;
  17.  
  18.  
  19. int main()
  20. {
  21.     ll n,m,i=0,t,j=0,ck=0,a=0,b=0;
  22.     j=3;
  23.     mp[1] = true;
  24.     mp[2] = true;
  25.     for(i = 4; i<mx; i+=(j++)) mp[i] = true;
  26.  
  27.     sc1(t);
  28.     while(t--){
  29.         sc1(n);
  30.         if(mp[n]==true)
  31.             cout<<"1 ";
  32.         else
  33.             cout<<"0 ";
  34.     }
  35.    
  36.     return 0;
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top