結果

問題 No.581 XOR
ユーザー AquaplusAquaplus
提出日時 2018-02-09 22:57:08
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 332 bytes
コンパイル時間 446 ms
コンパイル使用メモリ 61,520 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-17 05:46:38
合計ジャッジ時間 968 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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


int main(void)
{
    int a, c;
    int 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