結果

問題 No.197 手品
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-05-03 22:53:24
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,423 bytes
コンパイル時間 4,788 ms
コンパイル使用メモリ 75,388 KB
実行使用メモリ 58,088 KB
最終ジャッジ日時 2023-09-09 16:49:19
合計ジャッジ時間 12,884 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,448 KB
testcase_01 AC 125 ms
55,740 KB
testcase_02 AC 127 ms
56,016 KB
testcase_03 AC 127 ms
55,680 KB
testcase_04 AC 126 ms
55,744 KB
testcase_05 AC 128 ms
55,972 KB
testcase_06 AC 127 ms
55,692 KB
testcase_07 AC 129 ms
55,828 KB
testcase_08 AC 127 ms
51,608 KB
testcase_09 AC 126 ms
56,020 KB
testcase_10 AC 125 ms
55,948 KB
testcase_11 AC 128 ms
56,152 KB
testcase_12 AC 127 ms
55,900 KB
testcase_13 AC 128 ms
55,812 KB
testcase_14 AC 125 ms
56,036 KB
testcase_15 AC 127 ms
55,828 KB
testcase_16 AC 125 ms
55,728 KB
testcase_17 AC 124 ms
55,808 KB
testcase_18 AC 128 ms
58,088 KB
testcase_19 AC 127 ms
55,780 KB
testcase_20 AC 129 ms
56,080 KB
testcase_21 AC 127 ms
55,768 KB
testcase_22 AC 125 ms
55,456 KB
testcase_23 AC 126 ms
55,784 KB
testcase_24 AC 125 ms
56,096 KB
testcase_25 AC 126 ms
55,796 KB
testcase_26 AC 125 ms
55,876 KB
testcase_27 AC 126 ms
56,072 KB
testcase_28 AC 124 ms
55,452 KB
testcase_29 AC 123 ms
55,384 KB
testcase_30 AC 125 ms
56,064 KB
testcase_31 AC 128 ms
55,772 KB
testcase_32 WA -
testcase_33 AC 125 ms
55,676 KB
testcase_34 AC 124 ms
56,172 KB
testcase_35 AC 127 ms
56,036 KB
testcase_36 AC 126 ms
55,952 KB
testcase_37 AC 129 ms
55,844 KB
testcase_38 AC 126 ms
55,384 KB
testcase_39 AC 127 ms
56,024 KB
testcase_40 AC 127 ms
56,048 KB
testcase_41 AC 126 ms
55,656 KB
testcase_42 AC 126 ms
56,024 KB
testcase_43 AC 126 ms
56,088 KB
testcase_44 AC 127 ms
55,728 KB
testcase_45 AC 129 ms
55,720 KB
testcase_46 AC 127 ms
55,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//No.197 手品

import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;

public class No0197 {
    
    static final Scanner in = new Scanner(System.in);
    static final PrintWriter out = new PrintWriter(System.out,false);

    static void solve() {
        String sb = in.next();
        long n = in.nextLong();
        String sa = in.next();
        int cnt1 = 0, cnt2 = 0;
        for (int i=0; i<3; i++) {
            if (sb.charAt(i) == 'o') cnt1++;
            if (sa.charAt(i) == 'o') cnt2++;
        }
        if (cnt1 != cnt2) {
            out.println("SUCCESS");
        }else if (n >= 2) {
            out.println("FAILURE");
        }else if (n == 0) {
            out.println(sb != sa ? "FAILURE" : "SUCCESS");
        }else {
            out.println((sb.charAt(0) == sa.charAt(1) && sb.charAt(1) == sa.charAt(0) && sb.charAt(2) == sa.charAt(2))
                || (sb.charAt(0) == sa.charAt(0) && sb.charAt(1) == sa.charAt(2) && sb.charAt(2) == sa.charAt(1))
                ? "FAILURE" : "SUCCESS");
        }
    }

    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        solve();
        out.flush();

        long end = System.currentTimeMillis();
        //trace(end-start + "ms");
        in.close();
        out.close();
    }

    static void trace(Object... o) { System.out.println(deepToString(o));}
}
0