結果

問題 No.197 手品
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-05-03 22:54:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 1,000 ms
コード長 1,428 bytes
コンパイル時間 3,117 ms
コンパイル使用メモリ 75,072 KB
実行使用メモリ 56,904 KB
最終ジャッジ日時 2023-09-27 09:31:31
合計ジャッジ時間 10,213 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,864 KB
testcase_01 AC 113 ms
56,508 KB
testcase_02 AC 114 ms
55,952 KB
testcase_03 AC 116 ms
56,368 KB
testcase_04 AC 116 ms
55,708 KB
testcase_05 AC 116 ms
56,028 KB
testcase_06 AC 112 ms
56,024 KB
testcase_07 AC 116 ms
55,772 KB
testcase_08 AC 115 ms
55,992 KB
testcase_09 AC 113 ms
56,172 KB
testcase_10 AC 110 ms
55,876 KB
testcase_11 AC 114 ms
56,224 KB
testcase_12 AC 114 ms
56,028 KB
testcase_13 AC 114 ms
55,884 KB
testcase_14 AC 114 ms
56,004 KB
testcase_15 AC 112 ms
56,012 KB
testcase_16 AC 118 ms
55,992 KB
testcase_17 AC 115 ms
55,544 KB
testcase_18 AC 114 ms
55,888 KB
testcase_19 AC 115 ms
56,360 KB
testcase_20 AC 113 ms
56,236 KB
testcase_21 AC 114 ms
55,972 KB
testcase_22 AC 114 ms
56,184 KB
testcase_23 AC 114 ms
56,280 KB
testcase_24 AC 113 ms
56,120 KB
testcase_25 AC 118 ms
55,904 KB
testcase_26 AC 119 ms
55,928 KB
testcase_27 AC 119 ms
55,876 KB
testcase_28 AC 117 ms
55,920 KB
testcase_29 AC 112 ms
55,776 KB
testcase_30 AC 112 ms
56,224 KB
testcase_31 AC 113 ms
55,808 KB
testcase_32 AC 114 ms
55,716 KB
testcase_33 AC 116 ms
56,196 KB
testcase_34 AC 117 ms
56,308 KB
testcase_35 AC 115 ms
56,436 KB
testcase_36 AC 115 ms
55,760 KB
testcase_37 AC 116 ms
55,720 KB
testcase_38 AC 114 ms
55,412 KB
testcase_39 AC 117 ms
56,904 KB
testcase_40 AC 113 ms
55,712 KB
testcase_41 AC 114 ms
56,020 KB
testcase_42 AC 113 ms
56,400 KB
testcase_43 AC 113 ms
56,164 KB
testcase_44 AC 112 ms
56,264 KB
testcase_45 AC 114 ms
53,884 KB
testcase_46 AC 114 ms
56,568 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.equals(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