結果

問題 No.1674 Introduction to XOR
ユーザー 👑 CleyL
提出日時 2021-12-31 21:26:52
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 461 bytes
コンパイル時間 756 ms
コンパイル使用メモリ 67,840 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-09 02:08:09
合計ジャッジ時間 1,779 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
    long long n;cin>>n;
    vector<int> A(64);
    for(int i = 0; n > i; i++){
        long long x;cin>>x;
        int j = 0;
        while(x){
            A[j]+=(x%2);
            x/=2;
            j++;
        }
    }

    long long ans = 1;
    for(int i = 0; 64 > i; i++){
        if(A[i] == 0){
            cout << ans << endl;
            return 0;
        }
        ans *= 2;
    }
}
0