結果
| 問題 |
No.197 手品
|
| コンテスト | |
| ユーザー |
chiho_miyako
|
| 提出日時 | 2015-04-28 23:44:40 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,480 bytes |
| コンパイル時間 | 2,306 ms |
| コンパイル使用メモリ | 77,960 KB |
| 実行使用メモリ | 41,588 KB |
| 最終ジャッジ日時 | 2024-06-27 07:18:24 |
| 合計ジャッジ時間 | 9,695 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 38 WA * 5 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner koko = new Scanner(System.in);
String st = koko.next();
long n = koko.nextLong();
String end = koko.next();
int stm = 0;
int stb = 0;
int enm = 0;
int enb = 0;
for(int i=0; i<3; i++){
if(st.charAt(i)=='o'){
stm++;
}else{
stb++;
}
if(end.charAt(i)=='o'){
enm++;
}else{
enb++;
}
}
if(stb==enb&&stm==enm){
if(st.equals("oox")){
if(n==0&&!end.equals("oox")){
System.out.println("SUCCESS");
}else if(n==1&&end.equals("xoo")){
System.out.println("SUCCESS");
}else{
System.out.println("FAILURE");
}
}else if(st.equals("xoo")){
if(n==0&&!end.equals("xoo")){
System.out.println("SUCCESS");
}else if(n==1&&end.equals("oox")){
System.out.println("SUCCESS");
}else{
System.out.println("FAILURE");
}
}else if(st.equals("oxo")){
if(n==0&&!end.equals("oxo")){
System.out.println("SUCCESS");
}else if(n==1&&end.equals("oxo")){
System.out.println("SUCCESS");
}else{
System.out.println("FAILURE");
}
}else if(st.equals("xxo")){
if(n==0&&!end.equals("xxo")){
System.out.println("SUCCESS");
}else if(n==1&&end.equals("oxx")){
System.out.println("SUCCESS");
}else{
System.out.println("FAILURE");
}
}else if(st.equals("oxx")){
if(n==0&&!end.equals("oxx")){
System.out.println("SUCCESS");
}else if(n==1&&end.equals("xxo")){
System.out.println("SUCCESS");
}else{
System.out.println("FAILURE");
}
}else if(st.equals("xox")){
if(n==0&&!end.equals("xox")){
System.out.println("SUCCESS");
}else if(n==1&&end.equals("xox")){
System.out.println("SUCCESS");
}else{
System.out.println("FAILURE");
}
}
}else{
System.out.println("SUCCESS");
}
}
}
chiho_miyako