結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,740 KB
testcase_01 AC 2 ms
4,656 KB
testcase_02 AC 2 ms
4,624 KB
testcase_03 AC 3 ms
4,716 KB
testcase_04 AC 2 ms
4,804 KB
testcase_05 AC 2 ms
4,660 KB
testcase_06 AC 3 ms
4,664 KB
testcase_07 AC 3 ms
4,648 KB
testcase_08 AC 3 ms
4,600 KB
testcase_09 AC 3 ms
4,720 KB
testcase_10 AC 3 ms
4,716 KB
testcase_11 AC 2 ms
4,628 KB
testcase_12 AC 3 ms
4,532 KB
testcase_13 AC 3 ms
4,728 KB
testcase_14 AC 2 ms
4,740 KB
testcase_15 AC 2 ms
4,476 KB
testcase_16 AC 3 ms
4,552 KB
testcase_17 AC 2 ms
4,540 KB
testcase_18 AC 3 ms
4,520 KB
testcase_19 AC 2 ms
4,512 KB
testcase_20 AC 3 ms
4,728 KB
testcase_21 AC 2 ms
4,624 KB
testcase_22 AC 3 ms
4,700 KB
testcase_23 AC 2 ms
4,776 KB
testcase_24 AC 2 ms
4,656 KB
testcase_25 AC 2 ms
4,748 KB
testcase_26 AC 2 ms
4,796 KB
testcase_27 AC 2 ms
4,604 KB
testcase_28 AC 3 ms
4,516 KB
testcase_29 AC 2 ms
4,716 KB
testcase_30 AC 2 ms
4,604 KB
testcase_31 AC 2 ms
4,556 KB
testcase_32 WA -
testcase_33 AC 3 ms
4,508 KB
testcase_34 AC 2 ms
4,584 KB
testcase_35 AC 3 ms
4,716 KB
testcase_36 AC 3 ms
4,716 KB
testcase_37 AC 2 ms
4,732 KB
testcase_38 AC 2 ms
4,728 KB
testcase_39 AC 2 ms
4,528 KB
testcase_40 AC 3 ms
4,476 KB
testcase_41 AC 3 ms
4,660 KB
testcase_42 AC 3 ms
4,664 KB
testcase_43 AC 2 ms
4,508 KB
testcase_44 AC 3 ms
4,604 KB
testcase_45 AC 3 ms
4,512 KB
testcase_46 AC 2 ms
4,512 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 eq $af ? "SUCCESS" : "FAILURE";
    }
}


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 "oxx" if $t eq "xxo";
}
0