結果
問題 | No.2853 A + B Problem |
ユーザー |
![]() |
提出日時 | 2024-08-25 14:26:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 305 bytes |
コンパイル時間 | 627 ms |
コンパイル使用メモリ | 70,144 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-08-25 14:26:49 |
合計ジャッジ時間 | 1,499 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#include <iostream>#include <algorithm>#include <vector>#define rep(i, n) for(i = 0; i < n; i++)#define int long longusing namespace std;signed main() {int n;cin >> n;int ans = 1;for (int i = 0; i < 60; i++) {if ((n >> i) % 2) ans *= 2;}ans -= 2;cout << ans << endl;return 0;}