結果
| 問題 |
No.130 XOR Minimax
|
| コンテスト | |
| ユーザー |
MasKoaTS
|
| 提出日時 | 2021-11-04 11:03:14 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 493 bytes |
| コンパイル時間 | 989 ms |
| コンパイル使用メモリ | 71,400 KB |
| 最終ジャッジ日時 | 2025-01-25 11:23:48 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 WA * 19 |
ソースコード
#include <iostream>
#include <vector>
#define rep(i, l, n) for (int i = (l); i < (n); i++)
using namespace std;
template <class T>
using V = vector<T>;
int main(void) {
int n; cin >> n;
V<int> a(n);
rep(i, 0, n) {
cin >> a[i];
}
int ans = 0;
rep(i, 0, 36) {
int same = true;
int bit = a[0] & 1; a[0] >>= 1;
rep(j, 1, n) {
if ((a[j] & 1) != bit) {
same = false;
}
a[j] >>= 1;
}
if (same == false) {
ans |= 1 << i;
}
}
cout << ans << endl;
return 0;
}
MasKoaTS