Advertisement
Saleh127

CF 922B

Oct 8th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin.tie(0);cout.tie(0);
  9.  
  10. ll n,ans=0,i,j,k,l;
  11. cin>>n;
  12. for(i=1;i<=n-1;i++)
  13. {
  14. for(j=i+1;j<=n;j++)
  15. {
  16. k=i^j;
  17. if(i+j>k && j+k>i && k+i>j && i<j && j<k && i<k && k<=n)
  18. {
  19. ans++;
  20. }
  21. }
  22. }
  23. cout<<ans<<endl;
  24.  
  25. return 0;
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement