結果
問題 | No.2323 Nafmo、A+Bをする |
ユーザー |
![]() |
提出日時 | 2023-05-28 13:37:03 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 642 bytes |
コンパイル時間 | 1,855 ms |
コンパイル使用メモリ | 196,116 KB |
最終ジャッジ日時 | 2025-02-13 10:00:18 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;#define rep(i, n) for (int i = 0; i < n; i++)#define INF (1LL << 60)#define all(v) (v).begin(), (v).end()template <class T>void chmin(T &a, T b) {if (a > b) a = b;}template <class T>void chmax(T &a, T b) {if (a < b) a = b;}int main() {string A, B;cin >> A >> B;ll N = max(A.length(), B.length());while (A.size() < N) A = '0' + A;while (B.size() < N) B = '0' + B;ll ans = 0, b = 1;rep(i, N) {if (A[N - i - 1] != B[N - i - 1]) {ans += b;}b *= 2;}cout << ans << endl;}