結果

問題 No.2323 Nafmo、A+Bをする
ユーザー shin3110
提出日時 2023-05-28 15:35:15
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,472 bytes
コンパイル時間 2,840 ms
コンパイル使用メモリ 168,460 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-27 07:29:20
合計ジャッジ時間 3,093 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 17
権限があれば一括ダウンロードができます

ソースコード

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;
    if(s > t) swap(s, t);
    while(s.size() < t.size()) {
        s = '0' + s;
    }
    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;
        z += int(ans[i]);
    }
    cout << z << endl;
}
0