結果
問題 | No.1674 Introduction to XOR |
ユーザー |
![]() |
提出日時 | 2021-08-05 17:59:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 432 bytes |
コンパイル時間 | 2,071 ms |
コンパイル使用メモリ | 193,568 KB |
最終ジャッジ日時 | 2025-01-23 14:15:52 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; 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++) { ll t = 1LL << i; bool valid = true; for (int j = 0; j < n; j++) { if (a[j] & t) { valid = false; break; } } if (valid) { cout << t << "\n"; break; } } }