結果
問題 | No.88 次はどっちだ |
ユーザー | yuya178 |
提出日時 | 2017-06-20 13:26:36 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 55 ms / 5,000 ms |
コード長 | 2,285 bytes |
コンパイル時間 | 2,573 ms |
コンパイル使用メモリ | 78,328 KB |
実行使用メモリ | 37,144 KB |
最終ジャッジ日時 | 2024-10-02 04:45:38 |
合計ジャッジ時間 | 3,267 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 50 ms
36,912 KB |
testcase_01 | AC | 47 ms
36,932 KB |
testcase_02 | AC | 47 ms
36,688 KB |
testcase_03 | AC | 50 ms
36,796 KB |
testcase_04 | AC | 55 ms
37,056 KB |
testcase_05 | AC | 51 ms
36,652 KB |
testcase_06 | AC | 51 ms
36,928 KB |
testcase_07 | AC | 48 ms
37,100 KB |
testcase_08 | AC | 54 ms
36,820 KB |
testcase_09 | AC | 53 ms
36,752 KB |
testcase_10 | AC | 51 ms
37,144 KB |
ソースコード
import java.io.ByteArrayInputStream;import java.io.IOException;import java.io.InputStream;import java.io.PrintWriter;import java.util.Arrays;import java.util.InputMismatchException;import java.io.OutputStream;import java.util.StringTokenizer;import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.HashMap;import java.util.Map;/*** Built using CHelper plug-in* Actual solution is at the top*/public class Main {public static void main(String[] args) {InputStream inputStream = System.in;OutputStream outputStream = System.out;InputReader in = new InputReader(inputStream);PrintWriter out = new PrintWriter(outputStream);Task solver = new Task();solver.solve(1, in, out);out.close();}static class Task {public void solve(int testNumber, InputReader in, PrintWriter out) {String first = in.next();String next;if(first.equals("oda")) next = "yukiko";else next = "oda";int stone = 0;for(int i=0; i<8; i++){String board = in.next();for(int j=0; j<8 ;j++){if(board.charAt(j)=='w'||board.charAt(j)=='b'){stone++;}}}if(stone%2==0) out.println(first);else out.println(next);}}static class InputReader {public BufferedReader reader;public StringTokenizer tokenizer;public InputReader(InputStream stream) {reader = new BufferedReader(new InputStreamReader(stream), 32768);tokenizer = null;}public String next() {while (tokenizer == null || !tokenizer.hasMoreTokens()) {try {tokenizer = new StringTokenizer(reader.readLine());} catch (IOException e) {throw new RuntimeException(e);}}return tokenizer.nextToken();}public int nextInt() {return Integer.parseInt(next());}public long nextLong() {return Long.parseLong(next());}}}