結果

問題 No.345 最小チワワ問題
ユーザー tonyu0tonyu0
提出日時 2020-05-01 09:53:50
言語 Raku
(rakudo v2024.02)
結果
AC  
実行時間 546 ms / 2,000 ms
コード長 305 bytes
コンパイル時間 1,964 ms
コンパイル使用メモリ 131,192 KB
実行使用メモリ 133,184 KB
最終ジャッジ日時 2023-08-25 00:08:07
合計ジャッジ時間 18,202 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 444 ms
132,620 KB
testcase_01 AC 476 ms
133,088 KB
testcase_02 AC 456 ms
132,980 KB
testcase_03 AC 457 ms
132,616 KB
testcase_04 AC 447 ms
132,236 KB
testcase_05 AC 441 ms
132,216 KB
testcase_06 AC 442 ms
132,192 KB
testcase_07 AC 438 ms
132,288 KB
testcase_08 AC 459 ms
132,528 KB
testcase_09 AC 453 ms
132,748 KB
testcase_10 AC 479 ms
132,716 KB
testcase_11 AC 489 ms
132,800 KB
testcase_12 AC 536 ms
132,716 KB
testcase_13 AC 527 ms
132,704 KB
testcase_14 AC 546 ms
132,712 KB
testcase_15 AC 484 ms
132,728 KB
testcase_16 AC 485 ms
132,556 KB
testcase_17 AC 461 ms
132,396 KB
testcase_18 AC 503 ms
132,860 KB
testcase_19 AC 441 ms
132,372 KB
testcase_20 AC 450 ms
132,504 KB
testcase_21 AC 445 ms
132,288 KB
testcase_22 AC 464 ms
132,868 KB
testcase_23 AC 455 ms
132,484 KB
testcase_24 AC 458 ms
132,892 KB
testcase_25 AC 462 ms
132,748 KB
testcase_26 AC 465 ms
132,720 KB
testcase_27 AC 469 ms
132,628 KB
testcase_28 AC 482 ms
132,948 KB
testcase_29 AC 484 ms
132,628 KB
testcase_30 AC 473 ms
133,184 KB
testcase_31 AC 446 ms
132,136 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

my @s = get.comb;

my $ans = 1e4;

for 0..^@s.elems -> $i {
    for $i + 1..^@s.elems -> $j {
        for $j + 1..^@s.elems -> $k {
            if @s[$i] eq 'c' && @s[$j] eq 'w' && @s[$k] eq 'w' {
                $ans = $ans min ($k - $i + 1)
            }
        }
    }
}

say $ans == 1e4 ?? -1 !! $ans
0