結果

問題 No.197 手品
ユーザー kou6839kou6839
提出日時 2015-04-29 14:04:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 1,000 ms
コード長 1,119 bytes
コンパイル時間 2,127 ms
コンパイル使用メモリ 73,776 KB
実行使用メモリ 56,224 KB
最終ジャッジ日時 2023-09-27 09:28:39
合計ジャッジ時間 9,835 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,696 KB
testcase_01 AC 126 ms
55,724 KB
testcase_02 AC 125 ms
55,760 KB
testcase_03 AC 126 ms
55,728 KB
testcase_04 AC 125 ms
55,736 KB
testcase_05 AC 125 ms
55,696 KB
testcase_06 AC 126 ms
55,472 KB
testcase_07 AC 127 ms
55,880 KB
testcase_08 AC 124 ms
55,872 KB
testcase_09 AC 124 ms
55,412 KB
testcase_10 AC 124 ms
55,828 KB
testcase_11 AC 125 ms
55,792 KB
testcase_12 AC 124 ms
55,596 KB
testcase_13 AC 125 ms
55,836 KB
testcase_14 AC 126 ms
55,960 KB
testcase_15 AC 124 ms
55,812 KB
testcase_16 AC 127 ms
55,912 KB
testcase_17 AC 126 ms
55,660 KB
testcase_18 AC 126 ms
55,424 KB
testcase_19 AC 125 ms
55,944 KB
testcase_20 AC 125 ms
55,800 KB
testcase_21 AC 124 ms
56,224 KB
testcase_22 AC 125 ms
54,052 KB
testcase_23 AC 124 ms
56,024 KB
testcase_24 AC 125 ms
55,656 KB
testcase_25 AC 124 ms
55,836 KB
testcase_26 AC 125 ms
55,888 KB
testcase_27 AC 126 ms
55,676 KB
testcase_28 AC 123 ms
55,636 KB
testcase_29 AC 124 ms
55,872 KB
testcase_30 AC 124 ms
55,808 KB
testcase_31 AC 125 ms
56,036 KB
testcase_32 AC 124 ms
55,796 KB
testcase_33 AC 123 ms
55,556 KB
testcase_34 AC 125 ms
55,920 KB
testcase_35 AC 124 ms
55,760 KB
testcase_36 AC 123 ms
55,784 KB
testcase_37 AC 124 ms
55,616 KB
testcase_38 AC 124 ms
55,652 KB
testcase_39 AC 125 ms
55,748 KB
testcase_40 AC 124 ms
53,680 KB
testcase_41 AC 123 ms
55,612 KB
testcase_42 AC 124 ms
56,080 KB
testcase_43 AC 124 ms
55,468 KB
testcase_44 AC 123 ms
55,860 KB
testcase_45 AC 125 ms
55,884 KB
testcase_46 AC 124 ms
55,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main {
	static int[] tatesum,yokosum;
	public static void main(String[] args){
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String mae  = sc.next();
		int n = sc.nextInt();
		String ato = sc.next();
		if(n==0){
			if(mae.equals(ato)){
				System.out.println("FAILURE");
			}else{
				System.out.println("SUCCESS");
			}
		}else if(n==1){
			StringBuilder a = new StringBuilder(mae);
			char aa = a.charAt(0);
			a=a.deleteCharAt(0);
			a=a.insert(1, aa);
			StringBuilder b = new StringBuilder(mae);
			char bb = b.charAt(2);
			b=b.deleteCharAt(2);
			b=b.insert(1, bb);
			if(ato.equals(a.toString()) || ato.equals(b.toString())){
				System.out.println("FAILURE");
			}else{
				System.out.println("SUCCESS");
			}
		}else{
			int countmae =0;
			for(int i=0;i<3;i++){
				if(mae.charAt(i)=='o') countmae++;
			}
			int countato=0;
			for(int i=0;i<3;i++){
				if(ato.charAt(i)=='o') countato++;
			}
			if(countato==countmae){
				System.out.println("FAILURE");
			}else{
				System.out.println("SUCCESS");
			}
		}
	}
}
0