結果
| 問題 |
No.341 沈黙の期間
|
| コンテスト | |
| ユーザー |
tsunatama5
|
| 提出日時 | 2016-02-12 23:14:43 |
| 言語 | Perl (5.40.0) |
| 結果 |
OLE
|
| 実行時間 | - |
| コード長 | 668 bytes |
| コンパイル時間 | 207 ms |
| コンパイル使用メモリ | 7,936 KB |
| 実行使用メモリ | 7,808 KB |
| 最終ジャッジ日時 | 2024-09-22 04:53:56 |
| 合計ジャッジ時間 | 12,561 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | OLE * 1 -- * 2 |
| other | -- * 11 |
コンパイルメッセージ
Main.pl syntax OK
ソースコード
#!/usr/bin/perl
use Encode;
use utf8;
$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;
$max = $i;
for ($i=0;$i=$max;$i++) {
if ($ans[$i] > $ans[$i+1]) {
print "$ans[$i]";
} else {
print "$ans[$i+1]"
}
}
}
tsunatama5