結果
問題 | No.2323 Nafmo、A+Bをする |
ユーザー |
|
提出日時 | 2023-05-28 15:19:26 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 421 bytes |
コンパイル時間 | 1,655 ms |
コンパイル使用メモリ | 169,556 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-27 06:00:41 |
合計ジャッジ時間 | 2,694 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
//#define _GLIBCXX_DEBUG#include <bits/stdc++.h>using namespace std;using ll = long long;const double pi = 3.14159265359879323846264338327950288419;const int INF = 2147483647;using p = pair<long long, long long>;int main() {bitset<30> a, b;cin >> a >> b;auto tmp = a^b;ll now = 1, ans = 0;for(int i = 0; i < 30; i++){if(tmp.test(i)) ans += now;now *= 2;}cout << ans << endl;}