結果

問題 No.581 XOR
ユーザー Aquaplus
提出日時 2018-02-09 23:01:37
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 644 ms
コンパイル使用メモリ 61,244 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-08 17:47:35
合計ジャッジ時間 1,178 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
using namespace std;


int main(void)
{
    unsigned long long a, c;
    unsigned long long b = 0;
    cin >> a >> c;

    for(int i = 0; a!=0||c!=0; i++)
    {
        b += pow(2,i)*(a%2!=c%2);
        a /= 2;
        c /= 2;
    }
    cout << b;
    return 0;
}
0