結果

問題 No.601 Midpoint Erase
コンテスト
ユーザー tsuchinaga
提出日時 2019-03-14 12:44:42
言語 Go
(1.26.1)
コンパイル:
env GOCACHE=/tmp go build _filename_
実行:
./Main
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 502 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 12,729 ms
コンパイル使用メモリ 282,136 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2026-03-13 00:09:43
合計ジャッジ時間 12,446 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	var n, x, y int
	_, _ = fmt.Scan(&n)

	b := bufio.NewScanner(os.Stdin)
	b.Split(bufio.ScanWords)

	p := make(map[string]int)
	cnt := 0
	for i := 0; i < n; i++ {
		b.Scan()
		x, _ = strconv.Atoi(b.Text())
		b.Scan()
		y, _ = strconv.Atoi(b.Text())

		p[fmt.Sprintf("%d,%d", x%2, y%2)]++

		if p[fmt.Sprintf("%d,%d", x%2, y%2)]%2 == 0 {
			cnt++
		}
	}

	if cnt%2 == 1 {
		fmt.Println("Alice")
	} else {
		fmt.Println("Bob")
	}
}
0