結果

問題 No.601 Midpoint Erase
ユーザー bluemegane
提出日時 2018-10-09 11:31:56
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 826 bytes
コンパイル時間 2,374 ms
コンパイル使用メモリ 104,064 KB
実行使用メモリ 22,016 KB
最終ジャッジ日時 2024-10-12 16:18:15
合計ジャッジ時間 4,433 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Hello
{
    public static void Main()
    {
        var a = new int[4];
        var n = int.Parse(Console.ReadLine().Trim());
        for (int i = 0; i < n; i++)
        {
            string[] line = Console.ReadLine().Trim().Split(' ');
            var b = int.Parse(line[0]);
            var b2 = int.Parse(line[1]);
            if (b % 2 == 0)
            {
                if (b2 % 2 == 0) a[0]++;
                else a[1]++;
            }
            else
            {
                if (b2 % 2 == 0) a[2]++;
                else a[3]++;
            }
        }
        Console.WriteLine(getAns(a));

    }
    public static string getAns (int[] a)
    {
        var p = 0;
        for (int i = 0; i < 4; i++)
            p += a[i] / 2;
        return p % 2 == 0 ? "Bob" : "Alice";
    }
}
0