結果

問題 No.197 手品
ユーザー 37zigen37zigen
提出日時 2016-03-22 14:18:17
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 954 bytes
コンパイル時間 2,119 ms
コンパイル使用メモリ 73,668 KB
実行使用メモリ 58,244 KB
最終ジャッジ日時 2023-09-09 20:56:47
合計ジャッジ時間 9,843 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 125 ms
55,888 KB
testcase_02 AC 124 ms
55,452 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 124 ms
55,768 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 124 ms
55,756 KB
testcase_09 WA -
testcase_10 AC 123 ms
55,812 KB
testcase_11 AC 122 ms
56,056 KB
testcase_12 AC 122 ms
55,976 KB
testcase_13 AC 125 ms
55,972 KB
testcase_14 AC 123 ms
56,020 KB
testcase_15 AC 123 ms
55,764 KB
testcase_16 AC 123 ms
56,056 KB
testcase_17 AC 120 ms
55,740 KB
testcase_18 AC 122 ms
56,204 KB
testcase_19 AC 120 ms
56,068 KB
testcase_20 AC 120 ms
55,608 KB
testcase_21 AC 122 ms
55,888 KB
testcase_22 AC 124 ms
55,928 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 126 ms
55,636 KB
testcase_36 AC 124 ms
56,064 KB
testcase_37 AC 125 ms
55,984 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 126 ms
55,964 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 125 ms
55,900 KB
testcase_45 AC 125 ms
56,284 KB
testcase_46 AC 128 ms
55,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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("SUCCESS");
			}else if(str1.charAt(1)==str2.charAt(2)&&str1.charAt(2)==str2.charAt(1)){
				System.out.println("SUCCESS");
			}else{
				System.out.println("FAILURE");
			}
		}else if(n>=2){
			System.out.println("FAILURE");
		}else{
			System.err.println("ERROR");
		}
	}
}
0