結果

問題 No.423 ハムスター語初級(数詞)
ユーザー teioteio
提出日時 2020-07-26 17:27:42
言語 Perl
(5.38.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 4,764 KB
最終ジャッジ日時 2023-09-11 04:02:59
合計ジャッジ時間 998 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,656 KB
testcase_01 AC 3 ms
4,608 KB
testcase_02 AC 3 ms
4,704 KB
testcase_03 AC 3 ms
4,684 KB
testcase_04 AC 2 ms
4,676 KB
testcase_05 AC 3 ms
4,524 KB
testcase_06 AC 2 ms
4,536 KB
testcase_07 AC 3 ms
4,688 KB
testcase_08 AC 2 ms
4,764 KB
testcase_09 AC 2 ms
4,608 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

# use strict;
# use warnings;

chomp(my $s = <>);
$s =~ s/hamu/1/g;
$s =~ s/ham/0/g;
my $n = 0;
foreach (split(//, $s)) {
    $n <<= 1;
    $n |= $_;
}
my $b = sprintf('%b', $n * 2);
$b =~ s/1/hamu/g;
$b =~ s/0/ham/g;
print($b, "\n");
0