結果

問題 No.197 手品
ユーザー kou6839kou6839
提出日時 2015-04-29 14:00:32
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,111 bytes
コンパイル時間 2,115 ms
コンパイル使用メモリ 74,192 KB
実行使用メモリ 56,532 KB
最終ジャッジ日時 2023-09-09 16:06:31
合計ジャッジ時間 9,769 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,784 KB
testcase_01 AC 126 ms
55,984 KB
testcase_02 AC 127 ms
55,796 KB
testcase_03 AC 125 ms
56,044 KB
testcase_04 AC 125 ms
56,004 KB
testcase_05 AC 124 ms
56,060 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 123 ms
55,692 KB
testcase_09 AC 124 ms
55,852 KB
testcase_10 AC 125 ms
55,784 KB
testcase_11 AC 125 ms
56,380 KB
testcase_12 AC 123 ms
55,964 KB
testcase_13 AC 123 ms
55,748 KB
testcase_14 AC 125 ms
56,088 KB
testcase_15 AC 124 ms
55,872 KB
testcase_16 AC 123 ms
56,248 KB
testcase_17 AC 125 ms
56,028 KB
testcase_18 AC 125 ms
55,692 KB
testcase_19 AC 124 ms
55,804 KB
testcase_20 AC 125 ms
55,972 KB
testcase_21 AC 126 ms
55,708 KB
testcase_22 AC 125 ms
55,796 KB
testcase_23 AC 123 ms
56,308 KB
testcase_24 AC 123 ms
56,084 KB
testcase_25 AC 125 ms
56,128 KB
testcase_26 WA -
testcase_27 AC 125 ms
55,620 KB
testcase_28 AC 125 ms
55,724 KB
testcase_29 AC 124 ms
55,740 KB
testcase_30 WA -
testcase_31 AC 125 ms
55,940 KB
testcase_32 AC 124 ms
56,040 KB
testcase_33 AC 126 ms
56,056 KB
testcase_34 WA -
testcase_35 AC 124 ms
56,056 KB
testcase_36 AC 125 ms
56,236 KB
testcase_37 AC 126 ms
55,980 KB
testcase_38 AC 127 ms
55,852 KB
testcase_39 AC 128 ms
56,068 KB
testcase_40 WA -
testcase_41 AC 126 ms
56,180 KB
testcase_42 AC 125 ms
55,736 KB
testcase_43 AC 125 ms
55,880 KB
testcase_44 AC 125 ms
56,388 KB
testcase_45 AC 124 ms
55,756 KB
testcase_46 AC 125 ms
55,844 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.deleteCharAt(0);
			a.insert(0, aa);
			StringBuilder b = new StringBuilder(mae);
			char bb = b.charAt(0);
			b.deleteCharAt(0);
			b.insert(0, bb);
			if(mae.equals(a.toString()) || mae.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