結果
問題 |
No.1674 Introduction to XOR
|
ユーザー |
![]() |
提出日時 | 2021-09-19 20:32:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 617 bytes |
コンパイル時間 | 789 ms |
コンパイル使用メモリ | 93,760 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-02 00:48:39 |
合計ジャッジ時間 | 1,717 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 WA * 9 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <functional> #include <queue> #include <map> #include <cmath> #include <iomanip> #include <cstdio> using namespace std; const int INF = 1001001001; int main() { int n; cin >> n; vector<long long> a(n); long long sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum |= a[i]; } long long x = 1; for (int i = 0; i < 60; i++) { if (sum % 2 == 0) { cout << x << endl; return 0; } else { x *= 2; sum /= 2; } } return 0; }