結果

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
  int N; cin >> N;
  vector<ll> A(N);
  for (int i = 0; i < N; i ++) cin >> A[i];
  
  for (int i = 0; i < 62; i ++)
  {
    int cnt = 0;
    for (int j = 0; j < N; j ++)
    {
      if ((A[j] >> i) & 1) cnt ++;
    }
    if (cnt == 0)
    {
      cout << (1LL << i) << "\n";
      return 0;
    }
  }
}
0