結果
問題 | No.642 Two Operations No.1 |
ユーザー |
![]() |
提出日時 | 2018-02-02 22:58:36 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 398 bytes |
コンパイル時間 | 841 ms |
コンパイル使用メモリ | 89,000 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-31 08:05:49 |
合計ジャッジ時間 | 1,559 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 WA * 9 |
ソースコード
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <cmath> #include <queue> #include <map> #include <set> #include <bitset> #include <functional> using namespace std; typedef long long ll; int main() { ll n; cin >> n; int cnt = 0; while (n % 2 == 0) { n /= 2; ++cnt; } ll x = 1; while (x < n) x *= 2, ++cnt; cout << cnt + x - n << endl; return 0; }