結果

問題 No.197 手品
ユーザー 37zigen37zigen
提出日時 2016-03-22 14:21:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 1,000 ms
コード長 975 bytes
コンパイル時間 1,803 ms
コンパイル使用メモリ 74,092 KB
実行使用メモリ 56,632 KB
最終ジャッジ日時 2023-09-27 09:40:36
合計ジャッジ時間 8,717 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
55,900 KB
testcase_01 AC 110 ms
55,648 KB
testcase_02 AC 118 ms
55,624 KB
testcase_03 AC 111 ms
55,924 KB
testcase_04 AC 113 ms
56,632 KB
testcase_05 AC 118 ms
55,980 KB
testcase_06 AC 118 ms
56,088 KB
testcase_07 AC 113 ms
55,632 KB
testcase_08 AC 117 ms
55,992 KB
testcase_09 AC 118 ms
55,632 KB
testcase_10 AC 114 ms
55,768 KB
testcase_11 AC 117 ms
56,256 KB
testcase_12 AC 116 ms
56,032 KB
testcase_13 AC 118 ms
55,764 KB
testcase_14 AC 114 ms
55,660 KB
testcase_15 AC 113 ms
56,104 KB
testcase_16 AC 112 ms
56,356 KB
testcase_17 AC 112 ms
55,780 KB
testcase_18 AC 112 ms
56,036 KB
testcase_19 AC 112 ms
55,736 KB
testcase_20 AC 112 ms
55,812 KB
testcase_21 AC 114 ms
55,956 KB
testcase_22 AC 111 ms
55,620 KB
testcase_23 AC 112 ms
55,752 KB
testcase_24 AC 110 ms
56,068 KB
testcase_25 AC 116 ms
56,108 KB
testcase_26 AC 112 ms
55,984 KB
testcase_27 AC 112 ms
56,400 KB
testcase_28 AC 116 ms
56,252 KB
testcase_29 AC 109 ms
55,748 KB
testcase_30 AC 110 ms
55,952 KB
testcase_31 AC 112 ms
55,764 KB
testcase_32 AC 115 ms
56,068 KB
testcase_33 AC 115 ms
55,928 KB
testcase_34 AC 116 ms
56,248 KB
testcase_35 AC 118 ms
56,072 KB
testcase_36 AC 113 ms
56,400 KB
testcase_37 AC 110 ms
55,884 KB
testcase_38 AC 109 ms
56,116 KB
testcase_39 AC 114 ms
55,672 KB
testcase_40 AC 110 ms
56,160 KB
testcase_41 AC 111 ms
56,084 KB
testcase_42 AC 115 ms
55,816 KB
testcase_43 AC 115 ms
55,884 KB
testcase_44 AC 109 ms
55,772 KB
testcase_45 AC 112 ms
55,720 KB
testcase_46 AC 111 ms
55,696 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("SUCCESS");
		}else if(n==0){
			if(str1.equals(str2)){
				System.out.println("FAILURE");
			}else{
				System.out.println("SUCCESS");
			}
		}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