結果

問題 No.99 ジャンピング駒
ユーザー いともたやすく行われるえげつない行為いともたやすく行われるえげつない行為
提出日時 2017-02-23 15:55:36
言語 Go
(1.22.1)
結果
AC  
実行時間 64 ms / 5,000 ms
コード長 422 bytes
コンパイル時間 11,601 ms
コンパイル使用メモリ 212,100 KB
実行使用メモリ 5,656 KB
最終ジャッジ日時 2023-08-30 21:27:42
合計ジャッジ時間 12,841 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
5,656 KB
testcase_01 AC 64 ms
5,652 KB
testcase_02 AC 64 ms
5,652 KB
testcase_03 AC 64 ms
5,652 KB
testcase_04 AC 64 ms
5,652 KB
testcase_05 AC 64 ms
5,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

func solve(in io.Reader, out, err io.Writer) {
	num, result := 0, 0
	fmt.Fscan(in, &num)
	for temp, i := 0, 0; i < num; i++ {
		fmt.Fscan(in, &temp)
		if temp&1 == 0 {
			result += 2
		}
		result--
	}
	if result < 0 {
		result = -result
	}

	fmt.Fprintln(out, result)

}

func main() {
	br := bufio.NewReaderSize(os.Stdin, int(1e6))
	solve(br, os.Stdout, os.Stderr)
}
0