結果
問題 |
No.642 Two Operations No.1
|
ユーザー |
|
提出日時 | 2018-06-05 17:57:53 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 399 bytes |
コンパイル時間 | 1,303 ms |
コンパイル使用メモリ | 157,920 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-30 09:58:37 |
合計ジャッジ時間 | 1,967 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 10 |
ソースコード
#include<bits/stdc++.h> using namespace std; typedef pair<int, int> pii; int n, ans; int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> n; if (n == 1) { cout << 0 << endl; return 0; } if (n % 2 != 0) { n += 1; cout << n/2 + 1 << endl; } else { cout << (int)(log2(n)) << endl; } }