結果
問題 | No.104 国道 |
ユーザー |
![]() |
提出日時 | 2015-04-06 21:19:12 |
言語 | Perl (5.40.0) |
結果 |
AC
|
実行時間 | 7 ms / 5,000 ms |
コード長 | 257 bytes |
コンパイル時間 | 72 ms |
コンパイル使用メモリ | 6,688 KB |
実行使用メモリ | 5,888 KB |
最終ジャッジ日時 | 2024-07-04 03:28:13 |
合計ジャッジ時間 | 1,003 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
コンパイルメッセージ
Main.pl syntax OK
ソースコード
#!/usr/bin/perl use strict; use warnings; my $str =<>; chomp $str; my @array = split //, $str; my $ans = 1; for(my $i = 0; $i < length $str; $i++) { if($array[$i] eq 'L') { $ans *= 2; } else { $ans *= 2; $ans++; } } print "$ans\n"; exit;