結果
問題 |
No.1674 Introduction to XOR
|
ユーザー |
![]() |
提出日時 | 2021-09-23 14:57:40 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 421 bytes |
コンパイル時間 | 1,248 ms |
コンパイル使用メモリ | 165,200 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 09:27:19 |
合計ジャッジ時間 | 2,029 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include<bits/stdc++.h> using namespace std; const int N = 110; typedef long long ll; int n; ll a[N]; int main() { scanf("%d",&n); for(int i = 1;i <= n;i ++ ) scanf("%lld",&a[i]); ll sum = 0; for(int i = 1;i <= n;i ++ ) sum |= a[i]; int x = 0; for(x = 0; ; x ++) { if((sum & 1) == 0) break; sum >>= 1; } ll ans = 1ll << x; printf("%lld\n",ans); return 0; }