結果
問題 | No.392 2分木をたどれ |
ユーザー |
![]() |
提出日時 | 2018-05-26 03:09:27 |
言語 | Perl (5.26.3) |
結果 |
AC
|
実行時間 | 19 ms / 2,000 ms |
コード長 | 275 bytes |
コンパイル時間 | 28 ms |
使用メモリ | 5,160 KB |
最終ジャッジ日時 | 2023-01-28 14:08:00 |
合計ジャッジ時間 | 1,034 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 5 ms
5,160 KB |
testcase_01 | AC | 18 ms
5,000 KB |
testcase_02 | AC | 19 ms
4,904 KB |
コンパイルメッセージ
Main.pl syntax OK
ソースコード
use strict; use warnings; my $m = <>; chomp $m; while (defined(my $x = <>)) { $x++; my @arr; while ($x > 1) { if ($x % 2) { push @arr, "R"; } else { push @arr, "L"; } $x /= 2; $x = int($x); } print join('', reverse(@arr)) . "\n"; }