結果

問題 No.601 Midpoint Erase
ユーザー mbanmban
提出日時 2017-12-01 18:20:00
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 2,512 bytes
コンパイル時間 2,146 ms
コンパイル使用メモリ 104,972 KB
実行使用メモリ 27,012 KB
最終ジャッジ日時 2023-08-24 18:40:46
合計ジャッジ時間 5,267 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
20,660 KB
testcase_01 AC 54 ms
20,752 KB
testcase_02 AC 55 ms
20,620 KB
testcase_03 AC 108 ms
25,080 KB
testcase_04 AC 116 ms
27,012 KB
testcase_05 AC 98 ms
24,832 KB
testcase_06 AC 79 ms
24,788 KB
testcase_07 AC 113 ms
24,908 KB
testcase_08 AC 105 ms
22,824 KB
testcase_09 AC 113 ms
25,116 KB
testcase_10 AC 69 ms
24,676 KB
testcase_11 AC 140 ms
25,212 KB
testcase_12 AC 94 ms
24,960 KB
testcase_13 AC 55 ms
22,780 KB
testcase_14 AC 55 ms
20,788 KB
testcase_15 AC 55 ms
20,780 KB
testcase_16 AC 55 ms
20,828 KB
testcase_17 AC 55 ms
22,828 KB
testcase_18 AC 55 ms
20,692 KB
testcase_19 AC 55 ms
20,784 KB
testcase_20 AC 54 ms
22,804 KB
testcase_21 AC 55 ms
20,824 KB
testcase_22 AC 55 ms
20,784 KB
testcase_23 AC 55 ms
20,812 KB
testcase_24 AC 54 ms
20,580 KB
testcase_25 AC 56 ms
20,816 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Scanner
{
    private readonly char Separator = ' ';
    private int Index = 0;
    private string[] Line = new string[0];
    public string Next()
    {
        if (Index >= Line.Length)
        {
            Line = Console.ReadLine().Split(Separator);
            Index = 0;
        }
        var ret = Line[Index];
        Index++;
        return ret;
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public string[] StringArray()
    {
        Line = Console.ReadLine().Split(Separator);
        Index = Line.Length;
        return Line;
    }

    public int[] IntArray()
    {
        var l = StringArray();
        var res = new int[l.Length];
        for (int i = 0; i < l.Length; i++)
        {
            res[i] = int.Parse(l[i]);
        }
        return res;
    }

    public long[] LongArray()
    {
        var l = StringArray();
        var res = new long[l.Length];
        for (int i = 0; i < l.Length; i++)
        {
            res[i] = long.Parse(l[i]);
        }
        return res;
    }
}

struct P
{
    public int X, Y;
    public P(int x, int y)
    {
        X = x;
        Y = y;
    }
}
class Program
{
    private int N;
    private P[] XY;
    private void Scan()
    {
        var sc = new Scanner();
        N = sc.NextInt();
        XY = new P[N];
        for (int i = 0; i < N; i++)
        {
            int x = sc.NextInt();
            int y = sc.NextInt();
            XY[i] = new P(x, y);
        }
    }

    public void Solve()
    {
        Scan();
        int a = 0;
        int b = 0;
        int c = 0;
        int d = 0;
        foreach (var i in XY)
        {
            if (i.X % 2 == 0)
            {
                if (i.Y % 2 == 0)
                {
                    a++;
                }
                else
                {
                    b++;
                }
            }
            else
            {
                if (i.Y % 2 == 0)
                {
                    c++;
                }
                else
                {
                    d++;
                }
            }
        }
        var cnt = (a / 2) + (b / 2) + (c / 2) + (d / 2);
        Console.WriteLine(cnt % 2 == 0 ? "Bob" : "Alice");
    }

    static void Main(string[] args)
    {
        new Program().Solve();
    }
}
0