結果

問題 No.197 手品
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-05-03 22:51:25
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,423 bytes
コンパイル時間 3,375 ms
コンパイル使用メモリ 75,208 KB
実行使用メモリ 57,704 KB
最終ジャッジ日時 2023-09-09 16:40:44
合計ジャッジ時間 11,466 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
57,704 KB
testcase_01 AC 129 ms
55,832 KB
testcase_02 AC 127 ms
55,712 KB
testcase_03 AC 130 ms
55,864 KB
testcase_04 AC 125 ms
53,492 KB
testcase_05 AC 125 ms
55,660 KB
testcase_06 AC 129 ms
55,588 KB
testcase_07 AC 128 ms
56,256 KB
testcase_08 AC 126 ms
56,156 KB
testcase_09 AC 125 ms
55,708 KB
testcase_10 AC 128 ms
55,652 KB
testcase_11 AC 128 ms
56,064 KB
testcase_12 AC 127 ms
55,648 KB
testcase_13 AC 127 ms
55,668 KB
testcase_14 AC 127 ms
55,664 KB
testcase_15 AC 127 ms
55,348 KB
testcase_16 AC 128 ms
55,736 KB
testcase_17 AC 129 ms
55,340 KB
testcase_18 AC 129 ms
55,588 KB
testcase_19 AC 127 ms
55,564 KB
testcase_20 AC 126 ms
55,980 KB
testcase_21 AC 127 ms
55,452 KB
testcase_22 AC 127 ms
55,620 KB
testcase_23 WA -
testcase_24 AC 127 ms
55,348 KB
testcase_25 AC 127 ms
55,768 KB
testcase_26 AC 127 ms
56,160 KB
testcase_27 AC 125 ms
55,508 KB
testcase_28 AC 123 ms
55,772 KB
testcase_29 AC 125 ms
55,916 KB
testcase_30 AC 125 ms
56,104 KB
testcase_31 WA -
testcase_32 AC 126 ms
56,108 KB
testcase_33 AC 125 ms
55,824 KB
testcase_34 AC 126 ms
55,896 KB
testcase_35 AC 127 ms
55,844 KB
testcase_36 AC 128 ms
56,184 KB
testcase_37 AC 125 ms
55,664 KB
testcase_38 AC 125 ms
56,016 KB
testcase_39 AC 126 ms
56,020 KB
testcase_40 AC 126 ms
55,688 KB
testcase_41 AC 125 ms
55,924 KB
testcase_42 AC 126 ms
55,584 KB
testcase_43 AC 126 ms
55,684 KB
testcase_44 AC 127 ms
55,680 KB
testcase_45 AC 128 ms
55,568 KB
testcase_46 AC 126 ms
55,648 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