結果

問題 No.197 手品
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-28 23:50:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 1,000 ms
コード長 2,600 bytes
コンパイル時間 1,881 ms
コンパイル使用メモリ 73,972 KB
実行使用メモリ 56,564 KB
最終ジャッジ日時 2023-09-27 09:25:35
合計ジャッジ時間 8,780 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
56,020 KB
testcase_01 AC 111 ms
55,860 KB
testcase_02 AC 113 ms
55,528 KB
testcase_03 AC 112 ms
55,768 KB
testcase_04 AC 113 ms
55,780 KB
testcase_05 AC 112 ms
55,760 KB
testcase_06 AC 111 ms
55,912 KB
testcase_07 AC 110 ms
55,916 KB
testcase_08 AC 112 ms
55,824 KB
testcase_09 AC 111 ms
55,868 KB
testcase_10 AC 114 ms
56,564 KB
testcase_11 AC 114 ms
56,032 KB
testcase_12 AC 114 ms
55,812 KB
testcase_13 AC 113 ms
55,804 KB
testcase_14 AC 113 ms
55,572 KB
testcase_15 AC 111 ms
55,920 KB
testcase_16 AC 111 ms
55,960 KB
testcase_17 AC 109 ms
55,584 KB
testcase_18 AC 110 ms
56,312 KB
testcase_19 AC 113 ms
55,764 KB
testcase_20 AC 111 ms
56,136 KB
testcase_21 AC 110 ms
55,928 KB
testcase_22 AC 112 ms
56,168 KB
testcase_23 AC 120 ms
55,816 KB
testcase_24 AC 114 ms
55,576 KB
testcase_25 AC 113 ms
55,784 KB
testcase_26 AC 115 ms
56,156 KB
testcase_27 AC 115 ms
56,028 KB
testcase_28 AC 111 ms
55,820 KB
testcase_29 AC 113 ms
56,132 KB
testcase_30 AC 110 ms
55,772 KB
testcase_31 AC 111 ms
56,200 KB
testcase_32 AC 108 ms
55,524 KB
testcase_33 AC 112 ms
56,132 KB
testcase_34 AC 111 ms
55,532 KB
testcase_35 AC 109 ms
55,948 KB
testcase_36 AC 115 ms
56,008 KB
testcase_37 AC 106 ms
55,808 KB
testcase_38 AC 118 ms
55,808 KB
testcase_39 AC 116 ms
55,956 KB
testcase_40 AC 116 ms
55,580 KB
testcase_41 AC 114 ms
55,816 KB
testcase_42 AC 112 ms
56,200 KB
testcase_43 AC 108 ms
56,068 KB
testcase_44 AC 107 ms
56,296 KB
testcase_45 AC 106 ms
56,140 KB
testcase_46 AC 110 ms
55,780 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 if(st.equals("xxx")||st.equals("ooo")){
            	System.out.println("FAILURE");
            }
        }else{
        	System.out.println("SUCCESS");
        }
        
        
    }
}
0