結果

問題 No.197 手品
ユーザー crazybbb3crazybbb3
提出日時 2017-01-17 22:21:22
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 2,185 bytes
コンパイル時間 3,892 ms
コンパイル使用メモリ 80,236 KB
実行使用メモリ 51,780 KB
最終ジャッジ日時 2023-09-09 21:08:50
合計ジャッジ時間 8,605 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 61 ms
51,044 KB
testcase_02 AC 59 ms
50,812 KB
testcase_03 AC 58 ms
50,772 KB
testcase_04 AC 59 ms
50,964 KB
testcase_05 AC 59 ms
50,808 KB
testcase_06 AC 59 ms
50,764 KB
testcase_07 AC 61 ms
51,144 KB
testcase_08 AC 63 ms
50,820 KB
testcase_09 AC 62 ms
51,116 KB
testcase_10 AC 64 ms
51,064 KB
testcase_11 AC 65 ms
50,808 KB
testcase_12 AC 63 ms
51,300 KB
testcase_13 AC 62 ms
50,636 KB
testcase_14 AC 66 ms
51,616 KB
testcase_15 AC 64 ms
50,780 KB
testcase_16 AC 61 ms
50,692 KB
testcase_17 AC 62 ms
51,780 KB
testcase_18 AC 63 ms
51,168 KB
testcase_19 AC 62 ms
51,060 KB
testcase_20 AC 62 ms
51,052 KB
testcase_21 AC 63 ms
51,080 KB
testcase_22 AC 62 ms
51,144 KB
testcase_23 AC 62 ms
50,660 KB
testcase_24 AC 60 ms
50,636 KB
testcase_25 AC 60 ms
50,816 KB
testcase_26 AC 62 ms
50,640 KB
testcase_27 AC 61 ms
50,828 KB
testcase_28 AC 62 ms
50,788 KB
testcase_29 AC 62 ms
50,832 KB
testcase_30 AC 62 ms
51,092 KB
testcase_31 AC 63 ms
50,632 KB
testcase_32 AC 63 ms
51,012 KB
testcase_33 AC 62 ms
51,260 KB
testcase_34 AC 61 ms
51,296 KB
testcase_35 AC 61 ms
51,260 KB
testcase_36 AC 62 ms
51,616 KB
testcase_37 AC 61 ms
51,084 KB
testcase_38 AC 61 ms
51,776 KB
testcase_39 AC 61 ms
50,700 KB
testcase_40 AC 62 ms
50,700 KB
testcase_41 AC 59 ms
51,088 KB
testcase_42 WA -
testcase_43 AC 59 ms
51,164 KB
testcase_44 AC 59 ms
50,784 KB
testcase_45 AC 61 ms
50,884 KB
testcase_46 AC 61 ms
50,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.stream.IntStream;
import java.util.stream.LongStream;
import java.util.stream.Stream;

public class CreateInput {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    void solve() throws IOException {
        String s1 = ns();
        int n = ni();
        String s2 = ns();

        if (s1.chars().map(c -> c == 'o' ? 1 : 0).sum() != s2.chars().map(c -> c == 'o' ? 1 : 0).sum()) {
            out.println("SUCCESS");
        } else if (n == 0 && !s2.equals(s1)) {
            out.println("SUCCESS");
        } else if (n == 1 && new StringBuilder(s2).reverse().toString().equals(s1)) {
            out.println("SUCCESS");
        } else {
            out.println("FAILURE");
        }
    }

    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }

    int ni() throws IOException {
        return Integer.parseInt(ns());
    }

    long nl() throws IOException {
        return Long.parseLong(ns());
    }

    double nd() throws IOException {
        return Double.parseDouble(ns());
    }

    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }

    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }

    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        CreateInput main = new CreateInput();
        main.solve();
        out.close();
    }
}
0