結果

問題 No.353 ヘイトプラス
ユーザー yasunori
提出日時 2025-02-19 22:27:55
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 273 bytes
コンパイル時間 941 ms
コンパイル使用メモリ 78,108 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2025-02-19 22:27:58
合計ジャッジ時間 2,135 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int p(int x, int y) {
    if(x == 0) return y;
    if(y == 0) return x;

    int s = x ^ y;
    int t = (x & y) << 1;
    return p(s, t);
}

int main(){
    int a, b;
    cin >> a >> b;
    cout << p(a, b) << endl;
    return 0;
}
0