結果

問題 No.197 手品
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-28 23:44:40
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 2,480 bytes
コンパイル時間 2,322 ms
コンパイル使用メモリ 74,680 KB
実行使用メモリ 58,240 KB
最終ジャッジ日時 2023-09-09 14:24:01
合計ジャッジ時間 9,727 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 119 ms
55,888 KB
testcase_04 AC 119 ms
56,488 KB
testcase_05 AC 119 ms
55,980 KB
testcase_06 AC 119 ms
55,712 KB
testcase_07 AC 120 ms
55,960 KB
testcase_08 AC 119 ms
55,780 KB
testcase_09 AC 120 ms
56,160 KB
testcase_10 AC 119 ms
55,716 KB
testcase_11 AC 120 ms
54,436 KB
testcase_12 AC 119 ms
55,704 KB
testcase_13 AC 119 ms
55,888 KB
testcase_14 AC 122 ms
56,068 KB
testcase_15 AC 119 ms
55,940 KB
testcase_16 AC 120 ms
54,016 KB
testcase_17 AC 119 ms
56,004 KB
testcase_18 AC 118 ms
55,604 KB
testcase_19 AC 119 ms
55,936 KB
testcase_20 AC 120 ms
55,484 KB
testcase_21 AC 123 ms
56,220 KB
testcase_22 AC 119 ms
56,200 KB
testcase_23 AC 119 ms
55,860 KB
testcase_24 AC 118 ms
55,836 KB
testcase_25 AC 118 ms
56,160 KB
testcase_26 AC 117 ms
55,772 KB
testcase_27 AC 118 ms
55,944 KB
testcase_28 AC 118 ms
55,676 KB
testcase_29 AC 118 ms
55,812 KB
testcase_30 AC 119 ms
55,716 KB
testcase_31 WA -
testcase_32 AC 118 ms
56,376 KB
testcase_33 AC 118 ms
56,048 KB
testcase_34 AC 119 ms
56,836 KB
testcase_35 AC 120 ms
56,520 KB
testcase_36 AC 118 ms
56,228 KB
testcase_37 AC 118 ms
56,268 KB
testcase_38 AC 119 ms
56,420 KB
testcase_39 AC 119 ms
55,812 KB
testcase_40 AC 118 ms
55,884 KB
testcase_41 AC 120 ms
55,864 KB
testcase_42 WA -
testcase_43 AC 119 ms
55,672 KB
testcase_44 AC 119 ms
55,984 KB
testcase_45 AC 119 ms
56,028 KB
testcase_46 AC 119 ms
55,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        String st = koko.next();
        long n = koko.nextLong();
        String end = koko.next();
        int stm = 0;
        int stb = 0;
        int enm = 0;
        int enb = 0;
        for(int i=0; i<3; i++){
        	if(st.charAt(i)=='o'){
        		stm++;
        	}else{
        		stb++;
        	}
        	if(end.charAt(i)=='o'){
        		enm++;
        	}else{
        		enb++;
        	}
        }
        if(stb==enb&&stm==enm){
        	if(st.equals("oox")){
        	    if(n==0&&!end.equals("oox")){
        		    System.out.println("SUCCESS");
        	    }else if(n==1&&end.equals("xoo")){
        		    System.out.println("SUCCESS");
        	    }else{
        		    System.out.println("FAILURE");
        	    }
            }else if(st.equals("xoo")){
        	    if(n==0&&!end.equals("xoo")){
        		    System.out.println("SUCCESS");
        	    }else if(n==1&&end.equals("oox")){
            		System.out.println("SUCCESS");
            	}else{
        	    	System.out.println("FAILURE");
        	    }
            }else if(st.equals("oxo")){
            	if(n==0&&!end.equals("oxo")){
            		System.out.println("SUCCESS");
            	}else if(n==1&&end.equals("oxo")){
        	    	System.out.println("SUCCESS");
        	    }else{
        	    	System.out.println("FAILURE");
        	    }
            }else if(st.equals("xxo")){
        	    if(n==0&&!end.equals("xxo")){
        		    System.out.println("SUCCESS");
        	    }else if(n==1&&end.equals("oxx")){
        		    System.out.println("SUCCESS");
        	    }else{
        		    System.out.println("FAILURE");
        	    }
            }else if(st.equals("oxx")){
        	    if(n==0&&!end.equals("oxx")){
        		    System.out.println("SUCCESS");
        	    }else if(n==1&&end.equals("xxo")){
            		System.out.println("SUCCESS");
            	}else{
        	    	System.out.println("FAILURE");
        	    }
            }else if(st.equals("xox")){
            	if(n==0&&!end.equals("xox")){
            		System.out.println("SUCCESS");
            	}else if(n==1&&end.equals("xox")){
        	    	System.out.println("SUCCESS");
        	    }else{
        	    	System.out.println("FAILURE");
        	    }
            }
        }else{
        	System.out.println("SUCCESS");
        }
    }
}
0