結果

問題 No.197 手品
ユーザー k_kadorak_kadora
提出日時 2015-06-15 02:45:17
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,140 bytes
コンパイル時間 3,399 ms
コンパイル使用メモリ 77,556 KB
実行使用メモリ 56,272 KB
最終ジャッジ日時 2023-09-09 17:11:00
合計ジャッジ時間 11,373 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,848 KB
testcase_01 AC 127 ms
55,516 KB
testcase_02 AC 123 ms
53,780 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 124 ms
55,864 KB
testcase_06 AC 125 ms
55,716 KB
testcase_07 AC 124 ms
55,752 KB
testcase_08 AC 126 ms
55,936 KB
testcase_09 AC 124 ms
55,676 KB
testcase_10 AC 124 ms
55,728 KB
testcase_11 AC 124 ms
55,840 KB
testcase_12 AC 122 ms
55,716 KB
testcase_13 AC 123 ms
55,396 KB
testcase_14 AC 123 ms
55,952 KB
testcase_15 AC 123 ms
55,740 KB
testcase_16 AC 124 ms
56,152 KB
testcase_17 AC 126 ms
55,956 KB
testcase_18 AC 125 ms
55,940 KB
testcase_19 AC 124 ms
55,644 KB
testcase_20 AC 127 ms
53,828 KB
testcase_21 AC 124 ms
56,272 KB
testcase_22 AC 124 ms
55,852 KB
testcase_23 WA -
testcase_24 AC 124 ms
55,752 KB
testcase_25 AC 124 ms
55,652 KB
testcase_26 AC 125 ms
55,832 KB
testcase_27 AC 122 ms
56,052 KB
testcase_28 AC 124 ms
55,928 KB
testcase_29 AC 123 ms
55,932 KB
testcase_30 AC 123 ms
55,872 KB
testcase_31 WA -
testcase_32 AC 123 ms
55,824 KB
testcase_33 AC 127 ms
55,804 KB
testcase_34 AC 127 ms
55,712 KB
testcase_35 AC 124 ms
55,776 KB
testcase_36 AC 125 ms
55,924 KB
testcase_37 AC 123 ms
55,676 KB
testcase_38 AC 122 ms
55,916 KB
testcase_39 AC 123 ms
55,732 KB
testcase_40 AC 124 ms
55,676 KB
testcase_41 AC 124 ms
55,716 KB
testcase_42 AC 124 ms
55,428 KB
testcase_43 WA -
testcase_44 AC 129 ms
55,412 KB
testcase_45 AC 126 ms
55,844 KB
testcase_46 AC 125 ms
55,780 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 == 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