結果

問題 No.130 XOR Minimax
コンテスト
ユーザー MasKoaTS
提出日時 2021-11-04 11:03:14
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 493 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 601 ms
コンパイル使用メモリ 93,716 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-06-23 14:49:23
合計ジャッジ時間 2,420 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 2 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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;
}
0