結果

問題 No.601 Midpoint Erase
ユーザー bluemeganebluemegane
提出日時 2018-10-09 11:37:39
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 773 bytes
コンパイル時間 1,063 ms
コンパイル使用メモリ 103,168 KB
実行使用メモリ 22,016 KB
最終ジャッジ日時 2024-04-20 19:03:55
合計ジャッジ時間 3,060 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
17,920 KB
testcase_01 AC 24 ms
17,792 KB
testcase_02 AC 24 ms
17,664 KB
testcase_03 AC 81 ms
21,888 KB
testcase_04 AC 89 ms
21,888 KB
testcase_05 AC 70 ms
21,888 KB
testcase_06 AC 52 ms
21,888 KB
testcase_07 AC 84 ms
21,760 KB
testcase_08 AC 77 ms
21,888 KB
testcase_09 AC 89 ms
21,888 KB
testcase_10 AC 41 ms
20,736 KB
testcase_11 AC 111 ms
22,016 KB
testcase_12 AC 64 ms
21,632 KB
testcase_13 AC 24 ms
17,664 KB
testcase_14 AC 25 ms
17,536 KB
testcase_15 AC 25 ms
17,664 KB
testcase_16 AC 25 ms
17,664 KB
testcase_17 AC 25 ms
17,536 KB
testcase_18 AC 25 ms
17,664 KB
testcase_19 AC 25 ms
17,792 KB
testcase_20 AC 24 ms
17,792 KB
testcase_21 AC 24 ms
17,792 KB
testcase_22 AC 25 ms
17,792 KB
testcase_23 AC 24 ms
17,664 KB
testcase_24 AC 24 ms
17,664 KB
testcase_25 AC 24 ms
17,536 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 && b2 % 2 == 0) a[0]++;
            else if (b % 2 == 0 && b2 % 2 == 1) a[1]++;
            else if (b % 2 == 1 && 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