結果

問題 No.353 ヘイトプラス
ユーザー soupesuteaka
提出日時 2017-05-01 11:04:26
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 802 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 63,820 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-03 22:27:57
合計ジャッジ時間 1,012 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

// macros
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

#define LLINF 1000000000000000000LL
#define debug(a) cout << "L(" << __LINE__ << "):" << #a << ":" << a << endl;

// problems limits
#define MAX_N 100

// Variables
unsigned int A,B;

// problems input
void input()
{
    cin >> A >> B;
}

// problems main

void solve()
{
    unsigned int end = 1 << 31, c=0, ans=0;
    for (unsigned int i = 1; i != end; i <<= 1) {
        ans |= (A & i) ^ (B & i) ^ c;
        c = (((A&i) & (B&i)) | ((B&i) & (c)) | ((c) & (A&i))) << 1;
    }
    cout << ans << endl;
}

int main()
{
    ios::sync_with_stdio(false);

    input();

    solve();
}
0