結果
| 問題 |
No.197 手品
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-03-22 14:18:17 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 954 bytes |
| コンパイル時間 | 2,085 ms |
| コンパイル使用メモリ | 77,344 KB |
| 実行使用メモリ | 41,472 KB |
| 最終ジャッジ日時 | 2024-06-27 13:27:36 |
| 合計ジャッジ時間 | 9,223 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 22 WA * 21 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
String str1=sc.next();
int n=sc.nextInt();
String str2=sc.next();
int cntHasCoin1=0;
int cntHasCoin2=0;
for(int i=0;i<3;i++){
if(str1.charAt(i)=='o'){
cntHasCoin1++;
}
if(str2.charAt(i)=='o'){
cntHasCoin2++;
}
}
if(cntHasCoin1!=cntHasCoin2){
System.out.println("FAILURE");
}else if(n==0){
if(str1.equals(str2)){
System.out.println("SUCCESS");
}else{
System.out.println("FAILURE");
}
}else if(n==1){
if(str1.charAt(0)==str2.charAt(1)&&str1.charAt(1)==str2.charAt(0)){
System.out.println("SUCCESS");
}else if(str1.charAt(1)==str2.charAt(2)&&str1.charAt(2)==str2.charAt(1)){
System.out.println("SUCCESS");
}else{
System.out.println("FAILURE");
}
}else if(n>=2){
System.out.println("FAILURE");
}else{
System.err.println("ERROR");
}
}
}