結果
| 問題 | 
                            No.99 ジャンピング駒
                             | 
                    
| コンテスト | |
| ユーザー | 
                             t_murano
                         | 
                    
| 提出日時 | 2016-06-11 16:01:43 | 
| 言語 | Go  (1.23.4)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 709 bytes | 
| コンパイル時間 | 11,263 ms | 
| コンパイル使用メモリ | 218,728 KB | 
| 実行使用メモリ | 7,800 KB | 
| 最終ジャッジ日時 | 2024-10-11 05:13:54 | 
| 合計ジャッジ時間 | 20,649 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | RE * 6 | 
ソースコード
package main
import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)
func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func scanlnInt(n int) []int {
	x := make([]int, n)
	y := make([]interface{}, len(x))
	for i := range x {
		y[i] = &x[i]
	}
	n, e := fmt.Scanln(y...)
	if e != nil {
		panic(e)
	}
	x = x[:n]
	return x
}
func absInt(num int) int {
	if num < 0 {
		return -num
	}
	return num
}
func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	n := nextInt(sc)
	xList := scanlnInt(n)
	count := 0
	for _, v := range xList {
		if v%2 == 0 {
			count += 1
		} else {
			count -= 1
		}
	}
	fmt.Println(absInt(count))
}
            
            
            
        
            
t_murano