結果

問題 No.197 手品
ユーザー kuramu
提出日時 2016-01-28 23:40:38
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 1,102 bytes
コンパイル時間 1,937 ms
コンパイル使用メモリ 77,660 KB
実行使用メモリ 52,172 KB
最終ジャッジ日時 2024-06-27 13:16:24
合計ジャッジ時間 5,636 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 28 WA * 15
権限があれば一括ダウンロードができます

ソースコード

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();

	    	  char[] str1 = new char[3];
	    	  char[] str2 = new char[3];
	    	  for(int i=0;i<line1.length();i++){
    			  str1[i] = line1.charAt(i);
    			  str2[i] = line2.charAt(i);
	    	  }
	    	  if(n % 2 == 0){
	    		  if(line1.equals(line2) || str1[0]==str2[2] && str1[2]==str2[0]){
	    			  System.out.println("FAILURE");
	    		  }else{
	    			  System.out.println("SUCCESS");
	    		  }
	    	  }else{
	    		  if(str1[0]==str2[0] && str1[1]==str2[2] || str1[2]==str2[2] && str1[0] == str2[1]){
	    			  System.out.println("FAILURE");
	    		  }else{
	    			  System.out.println("SUCCESS");
	    		  }
	    	  }
	      } catch (IOException e) {
			e.printStackTrace();
	      }
	}
}
0