結果

問題 No.291 黒い文字列
ユーザー tailstails
提出日時 2015-10-16 23:48:39
言語 Perl
(5.38.0)
結果
AC  
実行時間 1,231 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 8,724 KB
最終ジャッジ日時 2023-09-29 02:02:22
合計ジャッジ時間 6,449 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,784 KB
testcase_01 AC 3 ms
4,516 KB
testcase_02 AC 3 ms
4,760 KB
testcase_03 AC 2 ms
4,696 KB
testcase_04 AC 2 ms
4,496 KB
testcase_05 AC 2 ms
4,708 KB
testcase_06 AC 2 ms
4,500 KB
testcase_07 AC 3 ms
4,644 KB
testcase_08 AC 3 ms
4,640 KB
testcase_09 AC 2 ms
4,796 KB
testcase_10 AC 3 ms
4,636 KB
testcase_11 AC 8 ms
4,880 KB
testcase_12 AC 12 ms
5,020 KB
testcase_13 AC 3 ms
4,720 KB
testcase_14 AC 3 ms
4,532 KB
testcase_15 AC 3 ms
4,720 KB
testcase_16 AC 458 ms
7,376 KB
testcase_17 AC 750 ms
7,752 KB
testcase_18 AC 455 ms
7,088 KB
testcase_19 AC 618 ms
6,152 KB
testcase_20 AC 577 ms
6,500 KB
testcase_21 AC 3 ms
4,816 KB
testcase_22 AC 1,231 ms
8,724 KB
testcase_23 AC 159 ms
5,244 KB
testcase_24 AC 838 ms
7,928 KB
testcase_25 AC 3 ms
4,808 KB
testcase_26 AC 3 ms
4,808 KB
testcase_27 AC 2 ms
4,696 KB
testcase_28 AC 3 ms
4,696 KB
testcase_29 AC 2 ms
4,744 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

@a=chr(0)x5;
for(<>=~/./g){
	if(y/KUROI//){
		$i=index("KUROI",$_);
		for(@a){
			++vec($_,$i,8) if vec($_,$i,8)<($i?vec($_,$i-1,8):20);
		}
	}elsif(/\?/){
		my%h;
		for(@a){
			for$i(0..4){
				$a=$_;
				++vec($a,$i,8),$h{$a}=0 if vec($a,$i,8)<($i?vec($a,$i-1,8):20);
			}
		}
		@a=keys%h;
	}
}
$b<vec($_,4,8) and $b=vec($_,4,8) for@a;
print $b+0;
0