結果
問題 |
No.1082 XORのXOR
|
ユーザー |
|
提出日時 | 2020-06-27 11:25:08 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 1,618 bytes |
コンパイル時間 | 1,886 ms |
コンパイル使用メモリ | 194,040 KB |
最終ジャッジ日時 | 2025-01-11 12:42:16 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define rrep(i,n) for (int i = (int)(n)-1; i>=0; --i) #define For(i,a,b) for(auto i=(a);i<=(b);++i) #define rFor(i,a,b) for(auto i=(b);i>=(a);--i) #define call(var) cerr<<#var<<"="<<var<<"\n"; #define dup(x,y) (((x)+(y)-1)/(y)) #define all(x) (x).begin(),(x).end() using ll=long long; using vi = vector<int>; using vl = vector<ll>; using vb = vector<bool>; using Graph = vector<vi>; using P = pair<int,int>; const int MOD=(int)1e9+7; const int INF=(int)1e9; const ll LINF=(ll)1e18; const double pi = acos(-1); template<class t,class u> inline bool chmax(t&a,u b){if(a<b){a=b;return true;}return false;} template<class t,class u> inline bool chmin(t&a,u b){if(b<a){a=b;return true;}return false;} template<class T> istream& operator>>(istream& is, vector<T>& a){rep(i,a.size()) is >> a[i]; return is;} template<class T> ostream& operator<<(ostream& os, vector<T>& a){rep(i,a.size()) os << a[i] << " "; return os;} template<class T, class U> istream& operator>>(istream& is, pair<T,U>& p){is >> p.first >> p.second; return is;} template<class T, class U> ostream& operator<<(ostream& os, const pair<T,U>& p){os << "("<< p.first << "," << p.second << ")"; return os;} template<class T, class U> ostream& operator<<(ostream& os, const map<T,U>& mp){for(auto& t : mp) os << t.first << " " << t.second << "\n"; return os;} int main(){ int n;cin >> n; vi a(n); cin >> a; int ans = 0; rep(i,n){ for(int j=i+1;j<n;++j){ chmax(ans, a[i]^a[j]); } } cout << ans << "\n"; }