結果

問題 No.99 ジャンピング駒
ユーザー tnoda_
提出日時 2015-01-19 23:35:00
言語 Go
(1.23.4)
結果
AC  
実行時間 1,090 ms / 5,000 ms
コード長 299 bytes
コンパイル時間 10,412 ms
コンパイル使用メモリ 223,068 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2024-10-10 02:59:35
合計ジャッジ時間 19,054 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
)

func main() {
	var n, even, odd int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		var x int
		fmt.Scan(&x)
		switch x & 1 {
		case 0:
			even++
		case 1:
			odd++
		default:
			panic("do not reach here")
		}
	}
	z := even - odd
	if z < 0 {
		z = -z
	}
	fmt.Println(z)
}
0