結果

問題 No.2853 A + B Problem
ユーザー srjywrdnprkt
提出日時 2024-10-15 14:26:25
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 2,032 ms
コンパイル使用メモリ 192,708 KB
最終ジャッジ日時 2025-02-24 19:47:58
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);

    //繰り上がりなし
    ll N, ans=1;
    cin >> N;
    for (int i=0; i<60; i++){
        if ((N>>i)&1){
            ans *= 2;
        }
    }

    //A=0, B=0となるケースを除く。
    cout << ans-2 << endl;

    return 0;
}
0