結果

問題 No.130 XOR Minimax
ユーザー codershifthcodershifth
提出日時 2015-08-13 21:57:19
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 910 bytes
コンパイル時間 1,173 ms
コンパイル使用メモリ 145,268 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-25 11:28:48
合計ジャッジ時間 2,644 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 10 ms
4,376 KB
testcase_05 AC 16 ms
4,380 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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,30)
            {
                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
0