結果
| 問題 |
No.642 Two Operations No.1
|
| コンテスト | |
| ユーザー |
ikd
|
| 提出日時 | 2018-02-03 12:32:29 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 437 bytes |
| コンパイル時間 | 792 ms |
| コンパイル使用メモリ | 99,248 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-12 23:47:25 |
| 合計ジャッジ時間 | 1,329 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
ソースコード
void main(){
import std.stdio, std.string, std.conv, std.algorithm;
long n; rd(n);
int c=0;
while(n>1){
if(n&1) n++;
else n/=2;
c++;
}
writeln(c);
}
void rd(T...)(ref T x){
import std.stdio, std.string, std.conv;
auto l=readln.split;
assert(l.length==x.length);
foreach(i, ref e; x){
e=l[i].to!(typeof(e));
}
}
void wr(T...)(T x){
import std.stdio;
foreach(e; x) write(e, " ");
writeln();
}
ikd