結果

問題 No.197 手品
ユーザー
提出日時 2015-12-12 07:44:57
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 636 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 5,332 KB
実行使用メモリ 4,852 KB
最終ジャッジ日時 2023-09-09 20:41:19
合計ジャッジ時間 1,906 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,604 KB
testcase_01 AC 2 ms
4,672 KB
testcase_02 AC 3 ms
4,796 KB
testcase_03 AC 3 ms
4,532 KB
testcase_04 AC 2 ms
4,532 KB
testcase_05 AC 3 ms
4,656 KB
testcase_06 AC 2 ms
4,740 KB
testcase_07 WA -
testcase_08 AC 3 ms
4,552 KB
testcase_09 AC 3 ms
4,852 KB
testcase_10 AC 2 ms
4,476 KB
testcase_11 AC 2 ms
4,712 KB
testcase_12 AC 2 ms
4,620 KB
testcase_13 AC 2 ms
4,600 KB
testcase_14 AC 3 ms
4,660 KB
testcase_15 AC 3 ms
4,616 KB
testcase_16 AC 3 ms
4,608 KB
testcase_17 AC 3 ms
4,624 KB
testcase_18 AC 3 ms
4,476 KB
testcase_19 AC 2 ms
4,536 KB
testcase_20 AC 2 ms
4,812 KB
testcase_21 AC 3 ms
4,736 KB
testcase_22 AC 2 ms
4,700 KB
testcase_23 AC 2 ms
4,612 KB
testcase_24 AC 3 ms
4,736 KB
testcase_25 AC 3 ms
4,588 KB
testcase_26 WA -
testcase_27 AC 3 ms
4,588 KB
testcase_28 AC 3 ms
4,736 KB
testcase_29 AC 2 ms
4,732 KB
testcase_30 WA -
testcase_31 AC 3 ms
4,516 KB
testcase_32 WA -
testcase_33 AC 3 ms
4,512 KB
testcase_34 WA -
testcase_35 AC 3 ms
4,660 KB
testcase_36 AC 2 ms
4,664 KB
testcase_37 AC 3 ms
4,620 KB
testcase_38 AC 3 ms
4,716 KB
testcase_39 AC 2 ms
4,772 KB
testcase_40 WA -
testcase_41 AC 2 ms
4,660 KB
testcase_42 AC 3 ms
4,520 KB
testcase_43 AC 2 ms
4,536 KB
testcase_44 AC 3 ms
4,664 KB
testcase_45 AC 3 ms
4,624 KB
testcase_46 AC 3 ms
4,732 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

chomp(my $be = <STDIN>);
chomp(my $n = <STDIN>);
chomp(my $af = <STDIN>);

my $be_num = $be =~ s/o/o/g;
my $af_num = $af =~ s/o/o/g;

my $result;
if (not $be_num == $af_num){
    $result = "SUCCESS";
}
else {
    if (not $n == 1) {
        $result = "FAILURE";
    }
    else {
        my $impo = impossible($be);
        $result = $impo == $af ? "FAILURE" : "SUCCESS";
    }
}


print "$result\n";

sub impossible {
    my $t = shift;
    return "oxo" if $t eq "oxo";
    return "xox" if $t eq "xox";
    return "oox" if $t eq "xoo";
    return "xoo" if $t eq "oox";
    return "xxo" if $t eq "oxx";
    return "oox" if $t eq "xoo";
}
0