Saleh127

codeforces 1365EC.cpp

Jun 8th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define Faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. #define pi acos(-1)
  7. #define yes printf("YES\n");
  8. #define no printf("NO\n");
  9. int main()
  10. {
  11. Faster
  12. ll n,a[1000],c,d=0,e,f,i,j,k,l;
  13. cin>>n;
  14. for(i=0;i<n;i++)
  15. {
  16. cin>>a[i];
  17. }
  18. for(i=0;i<n;i++)
  19. {
  20. for(j=0;j<n;j++)
  21. {
  22. for(k=0;k<n;k++)
  23. {
  24. d=max(d,(a[i] | a[j] | a[k]));
  25. }
  26. }
  27. }
  28. cout<<d<<endl;
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment