結果

問題 No.2323 Nafmo、A+Bをする
ユーザー shin3110shin3110
提出日時 2023-05-28 15:45:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,511 bytes
コンパイル時間 1,526 ms
コンパイル使用メモリ 165,928 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-27 12:53:24
合計ジャッジ時間 2,468 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*

              ∧∧∩ 
             ( ゚∀゚)/ キタ━━━━━━(゚∀゚)━━━━━━!!!!
            ⊂   ノ  ゆっくり見てってね!!!!!!!!
             (つ ノ
    o          (ノ
     \      ☆
             |      o
          (⌒ ⌒ヽ   /     ☆
    \  (´⌒  ⌒  ⌒ヾ   /
      ('⌒ ; ⌒   ::⌒  )
     (´     )     ::: ) /
  ☆─ (´⌒;:    ::⌒`) :;  )

*/

#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
#define _GLIBCXX_DEBUG


int main() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    string s, t; cin >>s >> t;
    while(s.size() < t.size()) {
        s = '0' + s;
    }
    while(t.size() < s.size()) {
        t = '0' + t;
    }
    string ans = "";
    rep(i, 0, s.size()) {
        if(s[i] == '1') {
            if(t[i] == '0') ans += '1';
            else ans += '0';
        } else {
            if(t[i] == '0') ans += '0';
            else ans += '1';
        }
    }
    int z = 0;
    rep(i, 0, ans.size()) {
        z *= 2;
        if(ans[i] == '1') z++;
    }
    cout << z << endl;
}
0