結果
問題 | No.341 沈黙の期間 |
ユーザー |
![]() |
提出日時 | 2016-02-12 23:30:43 |
言語 | Perl (5.40.0) |
結果 |
AC
|
実行時間 | 25 ms / 5,000 ms |
コード長 | 614 bytes |
コンパイル時間 | 150 ms |
コンパイル使用メモリ | 7,808 KB |
実行使用メモリ | 8,064 KB |
最終ジャッジ日時 | 2024-09-22 04:59:49 |
合計ジャッジ時間 | 1,143 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
コンパイルメッセージ
Main.pl syntax OK
ソースコード
#!/usr/bin/perluse Encode;use utf8;use List::Util qw/max min/;$count = 0;$tmpcount = 0;$temp =0;$i = 1;binmode STDIN, ':encoding(utf8)';#binmode STDOUT, ':encoding(cp932)';#binmode STDERR, ':encoding(CP932)';while (<STDIN>) {my $text = $_;my @te = split(//, $text);foreach my $tepart(@te) {if ($tepart eq "…") {if (($tmpcount+1) eq $temp) {$count++;} else {if ($count > 0) {$ans[$i] = $count;$i++;}$count = 1;}$tmpcount = $temp;}$temp++;}$ans[$i] = $count;if ($i == 1) {print "$ans[1]\n";} else {print max(@ans);}}