結果

問題 No.2323 Nafmo、A+Bをする
ユーザー t98slidert98slider
提出日時 2023-05-28 13:32:51
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 451 bytes
コンパイル時間 1,495 ms
コンパイル使用メモリ 167,872 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 20:48:14
合計ジャッジ時間 2,181 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s, t;
    cin >> s >> t;
    ll a = 0, b = 0;
    reverse(s.begin(), s.end());
    reverse(t.begin(), t.end());
    for(int i = 0; i < s.size(); i++){
        if(s[i] == '1') a |= 1ll << i;
    }
    for(int i = 0; i < t.size(); i++){
        if(t[i] == '1') b |= 1ll << i;
    }
    cout << (a ^ b) << '\n';
}
0