SHARE
TWEET

Untitled

a guest Apr 26th, 2019 45 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. typedef long double ld;
  6.  
  7. #define si(a)   scanf("%d", &a)
  8. #define si2(a,b) scanf("%d %d", &a, &b)
  9. #define sll(a) scanf("%I64d", &a)
  10. #define sll2(a,b) scanf ("%I64d %I64d", &a, &b)
  11. #define nln printf("\n")
  12. #define forr(i,a,b)      for(ll i=a;i<b;i++)
  13. #define foru(i,a,b)      for(ll i=a;i>b;i--)
  14. #define PI acos(-1)
  15. //#define pi(a)
  16.  
  17. int main()
  18. {
  19.     int n,c=0,t,a,b;
  20.     int q=0,p=0;
  21.     si(n);
  22.     for(a=1;a<=n;a++)
  23.     {
  24.         for(b=a+1;b<=n;b++)
  25.         {
  26.             t=a^b;
  27.             if(t<=n && a+b>t && a+t>b && b+t>a)
  28.             {
  29.                 p++;
  30.             }
  31.  
  32.         }
  33.     }
  34.     cout<<p/3;
  35. }
  36. //cout<<c;
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