結果

問題 No.88 次はどっちだ
ユーザー 37zigen37zigen
提出日時 2016-03-12 17:46:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 5,000 ms
コード長 745 bytes
コンパイル時間 4,060 ms
コンパイル使用メモリ 75,048 KB
実行使用メモリ 57,532 KB
最終ジャッジ日時 2023-10-25 08:07:41
合計ジャッジ時間 5,621 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
57,492 KB
testcase_01 AC 128 ms
57,476 KB
testcase_02 AC 117 ms
56,164 KB
testcase_03 AC 128 ms
57,456 KB
testcase_04 AC 127 ms
57,504 KB
testcase_05 AC 126 ms
57,468 KB
testcase_06 AC 127 ms
57,532 KB
testcase_07 AC 127 ms
57,488 KB
testcase_08 AC 128 ms
57,468 KB
testcase_09 AC 132 ms
57,472 KB
testcase_10 AC 128 ms
57,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package 練習;
import java.util.Scanner;


public class main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int cnt_w=0,cnt_b=0;
		String str_1=sc.next();
		String str_2;
		if(str_1.equals("oda")){
			str_2="yukiko";
		}else if(str_1.equals("yukiko")){
			str_2="oda";
		}else{
			str_2="";
			System.err.println("Error_at17");
		}
		
		for(int i=0;i<8;i++){
			String Str=sc.next();
			for(int j=0;j<8;j++){
				if(Str.charAt(j)=='w'){
					cnt_w++;
				}else if(Str.charAt(j)=='b'){
					cnt_b++;
				}
			}
			
		}
		if((cnt_w+cnt_b)%2==0){//wが先手。
			System.out.println(str_1);
		}else if((cnt_w+cnt_b)%2==1){
			System.out.println(str_2);
		}else{
			System.out.println("Error_at36");
		}
		
	}
}

0