結果
| 問題 |
No.130 XOR Minimax
|
| コンテスト | |
| ユーザー |
codershifth
|
| 提出日時 | 2015-08-13 09:31:31 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 910 bytes |
| コンパイル時間 | 1,306 ms |
| コンパイル使用メモリ | 159,320 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-18 09:13:34 |
| 合計ジャッジ時間 | 2,703 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 WA * 19 |
ソースコード
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
#define FOR(i,a,b) for(int (i)=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define RANGE(vec) (vec).begin(),(vec).end()
using namespace std;
class XorMinMax {
public:
void solve(void) {
int n;
cin>>n;
vector<int> a(n);
REP(i,n)
cin>>a[i];
int x = 0;
REP(k,28)
{
int m = 0;
REP(i,n)
{
if ((1<<k) & a[i])
++m;
}
if (0 < m && m < n)
x |= (1<<k);
}
cout<<x<<endl;
}
};
#if 1
int main(int argc, char *argv[])
{
ios::sync_with_stdio(false);
auto obj = new XorMinMax();
obj->solve();
delete obj;
return 0;
}
#endif
codershifth