結果
| 問題 |
No.197 手品
|
| コンテスト | |
| ユーザー |
kuramu
|
| 提出日時 | 2016-01-29 00:48:23 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,326 bytes |
| コンパイル時間 | 1,912 ms |
| コンパイル使用メモリ | 76,316 KB |
| 実行使用メモリ | 37,172 KB |
| 最終ジャッジ日時 | 2024-06-27 13:17:24 |
| 合計ジャッジ時間 | 5,475 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 41 WA * 2 |
ソースコード
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;
}else if(line1.equals(line2)){
System.out.println("FAILURE");
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();
}
}
}
kuramu