結果

問題 No.197 手品
ユーザー keitaro9mlkeitaro9ml
提出日時 2015-05-02 11:24:28
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,224 bytes
コンパイル時間 2,334 ms
コンパイル使用メモリ 74,648 KB
実行使用メモリ 56,640 KB
最終ジャッジ日時 2023-09-09 16:26:31
合計ジャッジ時間 9,643 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,368 KB
testcase_01 AC 123 ms
56,264 KB
testcase_02 AC 124 ms
55,692 KB
testcase_03 AC 124 ms
55,856 KB
testcase_04 AC 122 ms
56,124 KB
testcase_05 AC 125 ms
55,800 KB
testcase_06 AC 125 ms
55,768 KB
testcase_07 AC 124 ms
55,916 KB
testcase_08 AC 123 ms
55,952 KB
testcase_09 AC 125 ms
56,128 KB
testcase_10 AC 126 ms
56,308 KB
testcase_11 AC 122 ms
56,244 KB
testcase_12 AC 125 ms
55,876 KB
testcase_13 AC 125 ms
56,036 KB
testcase_14 AC 126 ms
55,684 KB
testcase_15 AC 126 ms
55,948 KB
testcase_16 AC 123 ms
55,484 KB
testcase_17 AC 124 ms
56,180 KB
testcase_18 AC 124 ms
55,808 KB
testcase_19 AC 124 ms
55,628 KB
testcase_20 AC 126 ms
56,044 KB
testcase_21 AC 125 ms
56,284 KB
testcase_22 AC 121 ms
56,056 KB
testcase_23 AC 121 ms
55,660 KB
testcase_24 AC 123 ms
55,788 KB
testcase_25 AC 123 ms
56,144 KB
testcase_26 WA -
testcase_27 AC 124 ms
55,832 KB
testcase_28 AC 123 ms
55,760 KB
testcase_29 AC 122 ms
56,156 KB
testcase_30 AC 121 ms
55,936 KB
testcase_31 AC 122 ms
56,092 KB
testcase_32 AC 123 ms
55,912 KB
testcase_33 AC 121 ms
55,484 KB
testcase_34 WA -
testcase_35 AC 124 ms
55,908 KB
testcase_36 AC 123 ms
56,012 KB
testcase_37 AC 125 ms
55,836 KB
testcase_38 AC 123 ms
56,340 KB
testcase_39 AC 125 ms
55,812 KB
testcase_40 AC 126 ms
55,776 KB
testcase_41 AC 126 ms
56,224 KB
testcase_42 AC 124 ms
55,772 KB
testcase_43 AC 123 ms
56,524 KB
testcase_44 AC 123 ms
56,640 KB
testcase_45 AC 122 ms
55,780 KB
testcase_46 AC 124 ms
53,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Scanner;
 
public class Main {
	
	static char[] Sb;
	static char[] Sa;
	static int N;
	
	private static void solve() {
		int sbo = 0;
		int sao = 0;
		
		for(int i = 0; i<3; i++){
			if(Sb[i] == 'o'){
				sbo++;
			}
			if(Sa[i] == 'o'){
				sao++;
			}
		}
		
		if(sbo != sao){
			System.out.println("SUCCESS");
			return;
		}
		
		if(N>=2){
			System.out.println("FAILURE");
			return;
		}
		
		ArrayList<char[]> list = new ArrayList<char[]>();
		list.add(Sb);
		
		if(N == 1){
			list.add(new char[]{Sb[1], Sb[0], Sb[2]});
			list.add(new char[]{Sb[0], Sb[2], Sb[1]});
		}
		
		Iterator<char[]> ite = list.iterator();
		while(ite.hasNext()){
			char[] c = ite.next();
			if(c[0] == Sa[0] && c[1] == Sa[1] && c[2] == Sa[2]){
				System.out.println("FAILURE");
				return;
			}
		}
		
		System.out.println("SUCCESS");
		return;		
	}
	
	public static void main(String[] args) {
		read();
		
		solve();
	}
	
	public static void read(){
		Scanner scan = new Scanner(new InputStreamReader(System.in));
		
		Sb = scan.next().toCharArray();
		N = scan.nextInt();
		Sa = scan.next().toCharArray();
		
		scan.close();
	}
	
}
0