結果

問題 No.1674 Introduction to XOR
ユーザー keisuke6
提出日時 2022-11-04 09:08:43
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 360 bytes
コンパイル時間 2,095 ms
コンパイル使用メモリ 195,712 KB
最終ジャッジ日時 2025-02-08 17:08:12
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int N;
  cin>>N;
  vector<int> S(N);
  for(int i=0;i<N;i++) cin>>S[i];
  int ans = 1;
  for(int i=0;i<100;i++){
      bool ok = true;
      for(int j=0;j<N;j++)if(S[j]&ans)ok = false;
      if(ok){
          cout<<ans<<endl;
          return 0;
      }
      ans *= 2;
  }
}
0