結果

問題 No.197 手品
ユーザー k_kadorak_kadora
提出日時 2015-06-15 02:48:03
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,145 bytes
コンパイル時間 3,893 ms
コンパイル使用メモリ 74,600 KB
実行使用メモリ 55,888 KB
最終ジャッジ日時 2023-09-09 17:11:24
合計ジャッジ時間 11,194 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,888 KB
testcase_01 AC 125 ms
55,436 KB
testcase_02 AC 126 ms
55,368 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 130 ms
55,744 KB
testcase_06 AC 126 ms
55,560 KB
testcase_07 AC 126 ms
55,324 KB
testcase_08 AC 125 ms
55,728 KB
testcase_09 AC 129 ms
55,720 KB
testcase_10 AC 126 ms
55,644 KB
testcase_11 AC 134 ms
55,664 KB
testcase_12 AC 125 ms
55,428 KB
testcase_13 AC 125 ms
55,656 KB
testcase_14 AC 127 ms
55,684 KB
testcase_15 AC 129 ms
55,484 KB
testcase_16 AC 126 ms
55,668 KB
testcase_17 AC 130 ms
55,556 KB
testcase_18 AC 130 ms
55,668 KB
testcase_19 AC 129 ms
55,664 KB
testcase_20 AC 131 ms
55,680 KB
testcase_21 AC 128 ms
53,680 KB
testcase_22 AC 127 ms
55,688 KB
testcase_23 AC 128 ms
53,820 KB
testcase_24 AC 123 ms
55,708 KB
testcase_25 AC 134 ms
55,556 KB
testcase_26 AC 131 ms
55,684 KB
testcase_27 AC 129 ms
55,656 KB
testcase_28 AC 126 ms
55,484 KB
testcase_29 AC 126 ms
55,356 KB
testcase_30 AC 130 ms
55,792 KB
testcase_31 AC 127 ms
55,364 KB
testcase_32 AC 128 ms
55,640 KB
testcase_33 AC 129 ms
55,336 KB
testcase_34 AC 126 ms
55,444 KB
testcase_35 AC 126 ms
55,652 KB
testcase_36 AC 126 ms
55,672 KB
testcase_37 AC 128 ms
55,668 KB
testcase_38 AC 131 ms
55,720 KB
testcase_39 AC 126 ms
55,556 KB
testcase_40 AC 128 ms
55,316 KB
testcase_41 AC 128 ms
55,820 KB
testcase_42 AC 126 ms
55,552 KB
testcase_43 WA -
testcase_44 AC 127 ms
55,692 KB
testcase_45 AC 126 ms
55,704 KB
testcase_46 AC 127 ms
55,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Yuki197{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		String be,af;
		int n,bo=0,ao=0,posb=0,posa=0;
		be = sc.next();
		n = sc.nextInt();
		af = sc.next();
		if(n == 0){
			if(be.equals(af)){
				System.out.println("FAILURE");
			}else{
				System.out.println("SUCCESS");
			}
		}else if(n == 1){
			for(int i = 0;i<3;i++){
				if(be.charAt(i) == 'o')bo++;
				if(af.charAt(i) =='o')ao++;
			}
			if(ao != bo){
				System.out.println("SUCCESS");
			}else{
				if(ao == 1){
					for(int i = 0;i<3;i++){
						if(be.charAt(i) == 'o')posb = i;
						if(af.charAt(i) == 'o')posa = i;
					}
					if(posb+posa != 2){
						System.out.println("FAILURE");
					}else{
						System.out.println("SUCCESS");
					}
				}else if(ao == 2){
					for(int i = 0;i<3;i++){
						if(be.charAt(i) != 'o')posb = i;
						if(af.charAt(i) != 'o')posa = i;
					}
					if(posb+posa != 2){
						System.out.println("FAILURE");
					}else{
						System.out.println("SUCCESS");
					}
				}else{
					System.out.println("FAILURE");
				}
			}
		}else{
			System.out.println("FAILURE");
		}
	}
}
0