結果

問題 No.88 次はどっちだ
ユーザー リチウムリチウム
提出日時 2014-11-24 17:31:32
言語 Java19
(openjdk 21)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 866 bytes
コンパイル時間 2,380 ms
コンパイル使用メモリ 74,028 KB
実行使用メモリ 56,300 KB
最終ジャッジ日時 2023-08-30 22:43:17
合計ジャッジ時間 4,381 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
56,288 KB
testcase_01 AC 114 ms
55,892 KB
testcase_02 AC 115 ms
55,824 KB
testcase_03 AC 115 ms
55,692 KB
testcase_04 AC 114 ms
56,056 KB
testcase_05 AC 117 ms
55,720 KB
testcase_06 AC 115 ms
55,444 KB
testcase_07 AC 115 ms
56,300 KB
testcase_08 AC 115 ms
56,088 KB
testcase_09 AC 113 ms
55,856 KB
testcase_10 AC 115 ms
55,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import static java.lang.Math.*;

public class Main {
	
	
  public static void main(String[] args) {
	  Scanner sc=new Scanner(System.in);
	  String s=sc.next();
	  int x=0;
	  if(s.equals("oda"))x=1;
	  String B[]=new String[8];
	  for(int i=0;i<8;i++){
		  B[i]=sc.next();
	  }
	  char b[][]=new char[8][8];
	  for(int i=0;i<8;i++){
		  char S[]=B[i].toCharArray();
		  for(int j=0;j<8;j++){
			  b[i][j]=S[j];
		  }
	  }
	  int k=0;
	  int bl=0;
	  int w=0;
	  for(int i=0;i<8;i++){
		  for(int j=0;j<8;j++){
			  if(b[i][j]=='.')k++;
			  if(b[i][j]=='w')w++;
			  if(b[i][j]=='b')bl++;
		  }
	  }
	  if(x==0 && k%2==0)System.out.println("yukiko");
	  if(x==0 && k%2==1)System.out.println("oda");
	  if (x==1 && k%2==0)System.out.println("oda");
	  if(x==1 && k%2==1)System.out.println("yukiko");
  }
}
  
0