結果

問題 No.197 手品
ユーザー kuramukuramu
提出日時 2016-01-29 00:10:58
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,073 bytes
コンパイル時間 1,989 ms
コンパイル使用メモリ 74,172 KB
実行使用メモリ 51,316 KB
最終ジャッジ日時 2023-09-09 20:44:48
合計ジャッジ時間 5,777 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 44 ms
49,148 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 44 ms
49,620 KB
testcase_08 AC 45 ms
49,052 KB
testcase_09 WA -
testcase_10 AC 44 ms
49,264 KB
testcase_11 AC 44 ms
49,032 KB
testcase_12 AC 44 ms
49,308 KB
testcase_13 AC 43 ms
49,120 KB
testcase_14 AC 43 ms
49,316 KB
testcase_15 AC 43 ms
49,412 KB
testcase_16 AC 43 ms
49,072 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 44 ms
49,092 KB
testcase_24 AC 43 ms
49,112 KB
testcase_25 WA -
testcase_26 AC 43 ms
49,268 KB
testcase_27 WA -
testcase_28 AC 43 ms
49,076 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 44 ms
49,304 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 43 ms
49,104 KB
testcase_35 AC 43 ms
49,200 KB
testcase_36 AC 43 ms
49,020 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 45 ms
49,464 KB
testcase_41 AC 44 ms
49,104 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 44 ms
49,264 KB
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
	public static void main(String[] args) {
	      BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in));
	      try {
	    	  String line1 = stdReader.readLine();
	    	  int n = Integer.parseInt(stdReader.readLine());
	    	  String line2 = stdReader.readLine();
	    	  int num1 = 0;
	    	  int num2 = 0;
	    	  for(int i=0;i<3;i++){
	    		  if(line1.charAt(i) == '○') num1++;
	    		  if(line2.charAt(i) == '○') num2++;    		  
	    	  }
	    	  if(num1 != num2){
	    		  System.out.println("SUCCESS");
	    		  return;
	    	  }
	    	  if(line1.equals(line2)){
	    	  }else if((line1.charAt(0)==line2.charAt(2))&&n>=2){
	    		  n-=2;
	    	  }else if((line1.charAt(0)!=line2.charAt(1)||line1.charAt(1)!=line2.charAt(2))&&n>=1){
	    		  n--;
	    	  }
	    	  if(n % 2 == 0) System.out.println("FAILURE");
	    	  else System.out.println("SUCCESS");
	      } catch (IOException e) {
			e.printStackTrace();
	      }
	}
}
0