結果

問題 No.1674 Introduction to XOR
ユーザー You_saku
提出日時 2021-09-16 00:16:15
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 641 bytes
コンパイル時間 701 ms
コンパイル使用メモリ 82,144 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-29 02:30:55
合計ジャッジ時間 1,928 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<map>
#include <ios>
#include <iomanip> 
#include<algorithm>

using namespace std;
long long MAX = 1000000000000000000;
int main(){
    int n;
    cin >> n;
    vector<long long>a(n);
    for(int i=0; i<n; i++){
        cin >> a[i];
    }
    for(int i = 0; ; i++){
        bool flag = true;
    long long tmp = 1LL << i;
        for(int j =0; j < n; j++){
            if(a[j] & tmp){
                flag = false;
                break;
            }
        }
        if(flag){
            cout << tmp << endl;
            return 0;
        }
    }
    return 0;
}
0