結果

問題 No.939 and or
ユーザー udonman
提出日時 2019-12-12 09:14:42
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 755 bytes
コンパイル時間 1,505 ms
コンパイル使用メモリ 158,204 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-24 17:57:26
合計ジャッジ時間 2,314 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25 WA * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:17:15: warning: ‘zo’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   17 |             zo++;
      |             ~~^~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
ll mod = 1e9+7;


int main(){
    ll a,b; cin >> a >> b;
    int zo,oz,oo,zz;
    for(int i=0;i<31;i++){
        int x=0; x = a%2;
        int y=0; y = b%2;
      
        if(x==0 && y==1)
            zo++;
        if(x==1 && y==0){
            oz++;
            cout << 0 << endl;
            return 0;
        }
        if(x==1 && y==1)
            oo++;
        if(x==0 && y==0)
            zz++;
        a/=2; b/=2;
    }
    ll ans;
    ans = pow(2,(zo-1));
  cout << ans << endl;
}
0