結果

問題 No.1459 スマホを落としたいだけなのに
ユーザー ぷら
提出日時 2021-03-31 22:19:08
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 509 bytes
コンパイル時間 1,358 ms
コンパイル使用メモリ 167,024 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-15 19:36:22
合計ジャッジ時間 2,333 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4 WA * 2
other AC * 4 WA * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main() {
    int N;
    cin >> N;
    int n = N;
    int ans = 0;
    int fans = 0;
    if(N%2 == 0) {
        while (N) {
            N /= 2;
            ans++;
        }
        N = n;
        N /= 2;
        N--;
        fans = 1+N;
        cout << max(ans,fans) << endl;
    }
    else {
        while (N) {
            N /= 2;
            ans++;
        }
        N = n;
        N /= 2;
        fans = 1+N;
        cout << max(ans,fans) << endl;
    }
}
0