結果

問題 No.197 手品
ユーザー 37zigen37zigen
提出日時 2016-03-22 14:19:41
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 975 bytes
コンパイル時間 2,002 ms
コンパイル使用メモリ 74,072 KB
実行使用メモリ 57,700 KB
最終ジャッジ日時 2023-09-09 20:57:14
合計ジャッジ時間 9,647 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,304 KB
testcase_01 AC 122 ms
55,644 KB
testcase_02 AC 120 ms
55,620 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 119 ms
55,388 KB
testcase_06 WA -
testcase_07 AC 120 ms
55,652 KB
testcase_08 AC 121 ms
55,628 KB
testcase_09 WA -
testcase_10 AC 123 ms
56,092 KB
testcase_11 AC 125 ms
55,704 KB
testcase_12 AC 122 ms
56,132 KB
testcase_13 AC 122 ms
55,392 KB
testcase_14 AC 120 ms
55,644 KB
testcase_15 AC 121 ms
56,204 KB
testcase_16 AC 123 ms
56,328 KB
testcase_17 AC 121 ms
55,752 KB
testcase_18 AC 120 ms
55,816 KB
testcase_19 AC 121 ms
55,784 KB
testcase_20 AC 121 ms
55,900 KB
testcase_21 AC 120 ms
55,708 KB
testcase_22 AC 121 ms
55,428 KB
testcase_23 WA -
testcase_24 AC 122 ms
55,636 KB
testcase_25 AC 119 ms
55,624 KB
testcase_26 AC 119 ms
56,020 KB
testcase_27 AC 120 ms
55,992 KB
testcase_28 AC 120 ms
55,884 KB
testcase_29 AC 121 ms
55,988 KB
testcase_30 AC 120 ms
55,764 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 120 ms
55,748 KB
testcase_34 AC 120 ms
55,964 KB
testcase_35 AC 120 ms
55,860 KB
testcase_36 AC 120 ms
56,108 KB
testcase_37 AC 119 ms
55,800 KB
testcase_38 AC 120 ms
55,660 KB
testcase_39 AC 121 ms
56,024 KB
testcase_40 AC 119 ms
55,640 KB
testcase_41 AC 121 ms
56,184 KB
testcase_42 AC 119 ms
55,692 KB
testcase_43 WA -
testcase_44 AC 120 ms
55,868 KB
testcase_45 AC 120 ms
55,628 KB
testcase_46 AC 122 ms
56,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder197;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String str1=sc.next();
		int n=sc.nextInt();
		String str2=sc.next();
		int cntHasCoin1=0;
		int cntHasCoin2=0;
		for(int i=0;i<3;i++){
			if(str1.charAt(i)=='o'){
				cntHasCoin1++;
			}
			if(str2.charAt(i)=='o'){
				cntHasCoin2++;
			}
		}
		if(cntHasCoin1!=cntHasCoin2){
			System.out.println("FAILURE");
		}else if(n==0){
			if(str1.equals(str2)){
				System.out.println("SUCCESS");
			}else{
				System.out.println("FAILURE");
			}
		}else if(n==1){
			if(str1.charAt(0)==str2.charAt(1)&&str1.charAt(1)==str2.charAt(0)){
				System.out.println("FAILURE");
			}else if(str1.charAt(1)==str2.charAt(2)&&str1.charAt(2)==str2.charAt(1)){
				System.out.println("FAILURE");
			}else{
				System.out.println("SUCCESS");
			}
		}else if(n>=2){
			System.out.println("FAILURE");
		}else{
			System.err.println("ERROR");
		}
	}
}
0