結果

問題 No.88 次はどっちだ
ユーザー ontama_12ontama_12
提出日時 2016-09-29 10:40:59
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 68 ms / 5,000 ms
コード長 892 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 39,296 KB
最終ジャッジ日時 2024-04-21 01:33:00
合計ジャッジ時間 1,466 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
39,168 KB
testcase_01 AC 68 ms
38,912 KB
testcase_02 AC 62 ms
39,040 KB
testcase_03 AC 63 ms
39,040 KB
testcase_04 AC 63 ms
39,040 KB
testcase_05 AC 61 ms
39,296 KB
testcase_06 AC 61 ms
39,168 KB
testcase_07 AC 61 ms
39,040 KB
testcase_08 AC 63 ms
38,912 KB
testcase_09 AC 66 ms
39,168 KB
testcase_10 AC 62 ms
39,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

   /////////////////////////////////No.88 次はどっちだ
    //入力文字読み取り
     var inputall = require('fs').readFileSync('/dev/stdin', 'utf8');

    //すべて受け取り改行で区切って格納
     var input = inputall.split("\n");

    //先手の名前を格納
     var firstman = input[0];

    //後攻の名前を格納
     if (firstman == "oda") {
         var secondman ="yukiko"
     } else {
         var secondman = "oda"
     }

    //盤にある石の数をカウント
    var count =0
     for (var i = 1; i < input.length; i++) {
         var reverse = input[i].split("");

         for(var j=0; j<reverse.length;j++){
             if (reverse[j] == "w" || reverse[j] == "b") {
                 count++
             }
         }  
     }

     if (count % 2 == 0) {
         console.log(firstman)
     } else {
         console.log(secondman)
     }
0