結果

問題 No.197 手品
ユーザー kuramukuramu
提出日時 2016-01-29 01:13:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 42 ms / 1,000 ms
コード長 1,457 bytes
コンパイル時間 4,599 ms
コンパイル使用メモリ 74,152 KB
実行使用メモリ 49,768 KB
最終ジャッジ日時 2023-09-27 09:38:13
合計ジャッジ時間 5,676 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
49,372 KB
testcase_01 AC 39 ms
49,672 KB
testcase_02 AC 40 ms
47,264 KB
testcase_03 AC 39 ms
49,368 KB
testcase_04 AC 42 ms
49,280 KB
testcase_05 AC 41 ms
49,284 KB
testcase_06 AC 40 ms
49,284 KB
testcase_07 AC 39 ms
49,708 KB
testcase_08 AC 39 ms
49,244 KB
testcase_09 AC 38 ms
49,348 KB
testcase_10 AC 39 ms
49,168 KB
testcase_11 AC 38 ms
49,460 KB
testcase_12 AC 40 ms
49,304 KB
testcase_13 AC 39 ms
49,284 KB
testcase_14 AC 40 ms
49,644 KB
testcase_15 AC 40 ms
49,320 KB
testcase_16 AC 40 ms
49,336 KB
testcase_17 AC 39 ms
49,336 KB
testcase_18 AC 39 ms
49,228 KB
testcase_19 AC 39 ms
49,508 KB
testcase_20 AC 40 ms
49,428 KB
testcase_21 AC 40 ms
49,124 KB
testcase_22 AC 39 ms
49,324 KB
testcase_23 AC 39 ms
49,676 KB
testcase_24 AC 40 ms
49,428 KB
testcase_25 AC 40 ms
49,444 KB
testcase_26 AC 41 ms
49,356 KB
testcase_27 AC 38 ms
49,232 KB
testcase_28 AC 40 ms
47,336 KB
testcase_29 AC 38 ms
49,180 KB
testcase_30 AC 38 ms
49,296 KB
testcase_31 AC 40 ms
49,332 KB
testcase_32 AC 39 ms
49,464 KB
testcase_33 AC 39 ms
49,336 KB
testcase_34 AC 40 ms
49,276 KB
testcase_35 AC 40 ms
49,256 KB
testcase_36 AC 40 ms
49,308 KB
testcase_37 AC 39 ms
49,768 KB
testcase_38 AC 40 ms
49,476 KB
testcase_39 AC 39 ms
49,468 KB
testcase_40 AC 40 ms
49,272 KB
testcase_41 AC 40 ms
49,292 KB
testcase_42 AC 39 ms
49,116 KB
testcase_43 AC 39 ms
49,244 KB
testcase_44 AC 38 ms
49,220 KB
testcase_45 AC 38 ms
49,124 KB
testcase_46 AC 39 ms
49,360 KB
権限があれば一括ダウンロードができます

ソースコード

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) == 'o') num1++;
	    		  if(line2.charAt(i) == 'o') num2++;    		  
	    	  }
	    	  if(num1 != num2){
	    		  System.out.println("SUCCESS");
	    		  return;
	    	  }
	    	  if(n==0){
	    		  if(line1.equals(line2)){
		    		  System.out.println("FAILURE");
	    		  }else{
	    			  System.out.println("SUCCESS");
	    		  }
	    	  }else if(n==1){
	    		  
	    		  if(line1.equals(line2) &&(line1.charAt(0)==line1.charAt(1) || line1.charAt(1)==line1.charAt(2)))
	    			  System.out.println("FAILURE");
	    		  else if(line1.equals(line2))
	    			  System.out.println("SUCCESS");	    		  
	    		  else if(line1.charAt(0)==line2.charAt(2)&&line1.charAt(2)==line2.charAt(0) && line1.charAt(0)!=line1.charAt(2))
	    			  System.out.println("SUCCESS");
	    		  else
	    			  System.out.println("FAILURE");
	    	  }else{
	    		  System.out.println("FAILURE");
	    	  }
	      } catch (IOException e) {
			e.printStackTrace();
	      }
	}
}
0