Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- typedef long double ld;
- #define si(a) scanf("%d", &a)
- #define si2(a,b) scanf("%d %d", &a, &b)
- #define sll(a) scanf("%I64d", &a)
- #define sll2(a,b) scanf ("%I64d %I64d", &a, &b)
- #define nln printf("\n")
- #define forr(i,a,b) for(ll i=a;i<b;i++)
- #define foru(i,a,b) for(ll i=a;i>b;i--)
- #define PI acos(-1)
- //#define pi(a)
- int main()
- {
- int n,c=0,t,a,b;
- int q=0,p=0;
- si(n);
- for(a=1;a<=n;a++)
- {
- for(b=a+1;b<=n;b++)
- {
- t=a^b;
- if(t<=n && a+b>t && a+t>b && b+t>a)
- {
- p++;
- }
- }
- }
- cout<<p/3;
- }
- //cout<<c;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement