結果

問題 No.601 Midpoint Erase
ユーザー tsuchinaga
提出日時 2019-03-14 12:44:42
言語 Go
(1.23.4)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 502 bytes
コンパイル時間 14,158 ms
コンパイル使用メモリ 221,500 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 08:15:02
合計ジャッジ時間 15,694 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

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