結果

問題 No.197 手品
ユーザー Mcpu3Mcpu3
提出日時 2018-09-16 16:29:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 1,000 ms
コード長 788 bytes
コンパイル時間 2,237 ms
コンパイル使用メモリ 73,736 KB
実行使用メモリ 57,844 KB
最終ジャッジ日時 2023-09-27 09:49:24
合計ジャッジ時間 8,527 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
57,844 KB
testcase_01 AC 109 ms
55,820 KB
testcase_02 AC 108 ms
55,984 KB
testcase_03 AC 109 ms
56,760 KB
testcase_04 AC 114 ms
55,760 KB
testcase_05 AC 106 ms
55,752 KB
testcase_06 AC 111 ms
55,736 KB
testcase_07 AC 107 ms
55,692 KB
testcase_08 AC 108 ms
55,768 KB
testcase_09 AC 110 ms
55,684 KB
testcase_10 AC 110 ms
56,044 KB
testcase_11 AC 109 ms
55,680 KB
testcase_12 AC 108 ms
55,816 KB
testcase_13 AC 105 ms
55,864 KB
testcase_14 AC 110 ms
56,008 KB
testcase_15 AC 110 ms
55,696 KB
testcase_16 AC 111 ms
56,136 KB
testcase_17 AC 111 ms
55,872 KB
testcase_18 AC 112 ms
55,488 KB
testcase_19 AC 115 ms
55,500 KB
testcase_20 AC 110 ms
56,016 KB
testcase_21 AC 108 ms
56,036 KB
testcase_22 AC 109 ms
56,084 KB
testcase_23 AC 113 ms
56,104 KB
testcase_24 AC 109 ms
55,728 KB
testcase_25 AC 110 ms
56,320 KB
testcase_26 AC 119 ms
56,508 KB
testcase_27 AC 110 ms
55,996 KB
testcase_28 AC 108 ms
56,056 KB
testcase_29 AC 110 ms
55,880 KB
testcase_30 AC 112 ms
55,816 KB
testcase_31 AC 109 ms
55,776 KB
testcase_32 AC 110 ms
56,080 KB
testcase_33 AC 111 ms
55,860 KB
testcase_34 AC 110 ms
56,076 KB
testcase_35 AC 111 ms
56,024 KB
testcase_36 AC 113 ms
56,368 KB
testcase_37 AC 110 ms
55,884 KB
testcase_38 AC 110 ms
56,056 KB
testcase_39 AC 112 ms
56,028 KB
testcase_40 AC 112 ms
56,348 KB
testcase_41 AC 117 ms
56,028 KB
testcase_42 AC 112 ms
56,052 KB
testcase_43 AC 107 ms
56,008 KB
testcase_44 AC 108 ms
55,464 KB
testcase_45 AC 107 ms
55,784 KB
testcase_46 AC 110 ms
55,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n,t[]=new int[2],f=0;
        String s[]=new String[2];
        s[0]=sc.next();
        n=sc.nextInt();
        s[1]=sc.next();
        sc.close();
        for(int i=0;i<2;++i)for(int j=0;j<3;++j)if(s[i].charAt(j)=='o')++t[i];
        if(t[0]!=t[1])f=1;
        else if(2>n&&(n>0&&(s[0].equals("oxo")&&s[1].equals("oxo")||s[0].equals("xox")&&s[1].equals("xox"))||s[0].equals("oox")&&s[1].equals("xoo")||s[0].equals("xoo")&&s[1].equals("oox")||s[0].equals("oxx")&&s[1].equals("xxo")||s[0].equals("xxo")&&s[1].equals("oxx")))f=1;
        else if(1>n&&!(s[0].equals(s[1])))f=1;
        System.out.print(f>0?"SUCCESS":"FAILURE");
    }
}
0