結果
| 問題 |
No.1674 Introduction to XOR
|
| コンテスト | |
| ユーザー |
mamimume____mo
|
| 提出日時 | 2021-09-10 22:14:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 806 bytes |
| コンパイル時間 | 1,795 ms |
| コンパイル使用メモリ | 165,704 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-12 00:38:04 |
| 合計ジャッジ時間 | 2,565 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1000000100;
const ll INFL = 2e18;
template <class T>bool chmin(T &a, T b){ if (a > b) { a = b; return true;} else return false;}
template <class T>bool chmax(T &a, T b){ if (a < b) { a = b; return true;} else return false;}
int main() {
int N;
cin >> N;
int cnt[61] = {};
for (int i = 0;i <= 60;i++) {
cnt[i] = N;
}
for (int i = 0;i < N;i++) {
int now = 0;
ll A;
cin >> A;
while(A > 0) {
if (A % 2 == 1)cnt[now]--;
A /= 2;
now++;
}
}
for (int i = 0;i <= 60;i++) {
if (cnt[i] == N) {
ll ans = 1LL << (ll)i;
cout << ans << endl;
return 0;
}
}
}
mamimume____mo