結果

問題 No.642 Two Operations No.1
ユーザー pin
提出日時 2018-02-03 19:12:31
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 452 bytes
コンパイル時間 900 ms
コンパイル使用メモリ 82,116 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-11 16:54:10
合計ジャッジ時間 1,410 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <cstring>
#include <algorithm> 
#include <math.h>
#include <queue>
#include <functional>
#include <map>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const int INF = 10000000;
int n;
int main(void){
    cin >> n;
    int ans = 0;
    ll t = 1;
    while (t < n){
        t *= 2;
        ans++;
    }
    ans += t - n;
    cout << ans << endl;
}
0