結果

問題 No.341 沈黙の期間
ユーザー tsunatama5tsunatama5
提出日時 2016-02-12 23:14:43
言語 Perl
(5.38.2)
結果
OLE  
実行時間 -
コード長 668 bytes
コンパイル時間 519 ms
コンパイル使用メモリ 8,012 KB
実行使用メモリ 12,292 KB
最終ジャッジ日時 2023-10-22 03:27:49
合計ジャッジ時間 13,060 ms
ジャッジサーバーID
(参考情報)
judge11 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 OLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/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]"
    	}
    }
}
0