結果

問題 No.197 手品
ユーザー kuramukuramu
提出日時 2016-01-29 00:49:22
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,231 bytes
コンパイル時間 2,034 ms
コンパイル使用メモリ 73,632 KB
実行使用メモリ 49,644 KB
最終ジャッジ日時 2023-09-09 20:45:49
合計ジャッジ時間 5,765 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 45 ms
49,308 KB
testcase_02 AC 44 ms
49,548 KB
testcase_03 AC 45 ms
49,032 KB
testcase_04 AC 44 ms
49,348 KB
testcase_05 AC 44 ms
49,232 KB
testcase_06 AC 44 ms
49,316 KB
testcase_07 AC 43 ms
49,552 KB
testcase_08 AC 44 ms
49,192 KB
testcase_09 AC 44 ms
49,032 KB
testcase_10 AC 44 ms
49,408 KB
testcase_11 AC 45 ms
48,980 KB
testcase_12 AC 43 ms
49,220 KB
testcase_13 AC 43 ms
47,448 KB
testcase_14 AC 45 ms
49,188 KB
testcase_15 AC 44 ms
49,180 KB
testcase_16 AC 45 ms
49,272 KB
testcase_17 AC 43 ms
49,248 KB
testcase_18 AC 44 ms
49,180 KB
testcase_19 AC 45 ms
49,404 KB
testcase_20 AC 42 ms
49,248 KB
testcase_21 AC 44 ms
49,572 KB
testcase_22 AC 44 ms
49,288 KB
testcase_23 AC 45 ms
49,644 KB
testcase_24 AC 44 ms
49,224 KB
testcase_25 AC 43 ms
49,236 KB
testcase_26 AC 43 ms
49,032 KB
testcase_27 WA -
testcase_28 AC 45 ms
49,376 KB
testcase_29 WA -
testcase_30 AC 44 ms
49,480 KB
testcase_31 AC 43 ms
49,316 KB
testcase_32 AC 43 ms
49,344 KB
testcase_33 WA -
testcase_34 AC 44 ms
49,184 KB
testcase_35 AC 44 ms
49,324 KB
testcase_36 AC 44 ms
49,344 KB
testcase_37 AC 43 ms
49,272 KB
testcase_38 AC 45 ms
49,256 KB
testcase_39 WA -
testcase_40 AC 44 ms
49,220 KB
testcase_41 AC 45 ms
49,316 KB
testcase_42 WA -
testcase_43 AC 44 ms
49,256 KB
testcase_44 AC 43 ms
49,620 KB
testcase_45 AC 44 ms
49,364 KB
testcase_46 AC 46 ms
49,264 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)==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