結果

問題 No.601 Midpoint Erase
ユーザー te-sh
提出日時 2018-01-10 13:35:31
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 575 bytes
コンパイル時間 678 ms
コンパイル使用メモリ 98,736 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-12 23:27:53
合計ジャッジ時間 2,117 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.algorithm, std.conv, std.range, std.stdio, std.string;

void main()
{
  auto n = read1!int;
  auto ee = 0, eo = 0, oe = 0, oo = 0;
  foreach (i; 0..n) {
    int x, y; read2(x, y);
    if      (!(x&1) && !(y&1)) ++ee;
    else if (!(x&1) &&  (y&1)) ++eo;
    else if ( (x&1) && !(y&1)) ++oe;
    else                       ++oo;
  }
  auto t = ee/2 + eo/2 + oe/2 + oo/2;
  writeln(t&1 ? "Alice" : "Bob");
}

T read1(T)() { return readln.chomp.to!T; }
void read2(S,T)(ref S a, ref T b) { auto r = readln.splitter; a = r.front.to!S; r.popFront(); b = r.front.to!T; }
0