結果

問題 No.345 最小チワワ問題
ユーザー teioteio
提出日時 2020-07-25 08:20:16
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 208 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 4,828 KB
最終ジャッジ日時 2023-09-09 03:19:19
合計ジャッジ時間 1,520 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,604 KB
testcase_01 AC 2 ms
4,656 KB
testcase_02 AC 2 ms
4,656 KB
testcase_03 AC 2 ms
4,776 KB
testcase_04 AC 2 ms
4,592 KB
testcase_05 WA -
testcase_06 AC 3 ms
4,540 KB
testcase_07 AC 2 ms
4,772 KB
testcase_08 AC 2 ms
4,768 KB
testcase_09 AC 2 ms
4,744 KB
testcase_10 AC 2 ms
4,808 KB
testcase_11 AC 2 ms
4,520 KB
testcase_12 AC 2 ms
4,656 KB
testcase_13 AC 3 ms
4,648 KB
testcase_14 AC 2 ms
4,656 KB
testcase_15 AC 3 ms
4,532 KB
testcase_16 AC 3 ms
4,652 KB
testcase_17 AC 3 ms
4,776 KB
testcase_18 WA -
testcase_19 AC 3 ms
4,712 KB
testcase_20 AC 3 ms
4,596 KB
testcase_21 AC 3 ms
4,744 KB
testcase_22 AC 3 ms
4,816 KB
testcase_23 AC 3 ms
4,692 KB
testcase_24 AC 2 ms
4,648 KB
testcase_25 AC 2 ms
4,732 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 2 ms
4,524 KB
testcase_29 AC 2 ms
4,520 KB
testcase_30 AC 2 ms
4,652 KB
testcase_31 AC 2 ms
4,628 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

# use strict;
# use warnings;

chomp(my $S = <>);
my @r;
while ($S =~ /c[^c]*?w[^w]*?w/g) {
    push(@r, length(substr($S, $-[0], $+[0] - $-[0])));
}
print(scalar(@r) ? (sort({$a <=> $b} @r))[0] : -1, "\n");
0