結果
問題 | No.642 Two Operations No.1 |
ユーザー |
|
提出日時 | 2018-03-28 23:11:47 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 266 bytes |
コンパイル時間 | 420 ms |
コンパイル使用メモリ | 55,872 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 13:54:04 |
合計ジャッジ時間 | 1,043 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
#include <iostream> using namespace std; typedef long long LL; int main(int argc, char* argv[]) { LL N; cin>>N; if (N==1){ cout<<0<<endl; return 0; } int aw=0; while(N>1){ if (N%2==1){ N++; aw++; } N/=2; aw++; } cout<<aw<<endl; return 0; }