結果

問題 No.642 Two Operations No.1
ユーザー motimoti
提出日時 2018-05-24 00:41:56
言語 Perl
(5.38.2)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 181 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 5,396 KB
実行使用メモリ 5,076 KB
最終ジャッジ日時 2023-09-11 02:09:28
合計ジャッジ時間 1,423 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
4,916 KB
testcase_01 AC 5 ms
4,916 KB
testcase_02 AC 5 ms
4,836 KB
testcase_03 AC 5 ms
5,060 KB
testcase_04 AC 5 ms
4,988 KB
testcase_05 AC 5 ms
4,832 KB
testcase_06 AC 5 ms
4,996 KB
testcase_07 AC 5 ms
4,704 KB
testcase_08 AC 5 ms
5,048 KB
testcase_09 AC 5 ms
5,076 KB
testcase_10 AC 5 ms
4,756 KB
testcase_11 AC 5 ms
4,724 KB
testcase_12 AC 5 ms
4,944 KB
testcase_13 AC 4 ms
5,064 KB
testcase_14 AC 5 ms
4,836 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#/usr/bin/env perl
use strict;
use warnings;

my $n = <>;
my $count = 0;
while ($n > 1) {
  if ($n % 2 == 1) {
    $n++;
  } else {
    $n /= 2;
  }
  $count++;
}
print "$count\n";
0