結果

問題 No.99 ジャンピング駒
ユーザー バカらっくバカらっく
提出日時 2018-03-02 16:15:09
言語 Swift
(5.10.0)
結果
AC  
実行時間 200 ms / 5,000 ms
コード長 267 bytes
コンパイル時間 3,338 ms
コンパイル使用メモリ 127,196 KB
実行使用メモリ 14,112 KB
最終ジャッジ日時 2023-08-20 10:26:51
合計ジャッジ時間 3,433 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 197 ms
13,400 KB
testcase_01 AC 196 ms
13,836 KB
testcase_02 AC 197 ms
13,320 KB
testcase_03 AC 199 ms
13,568 KB
testcase_04 AC 200 ms
14,112 KB
testcase_05 AC 197 ms
13,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let komaCount = Int(readLine()!)!

let inpt = readLine()!.split(separator: " ").map{Int($0)!}

var odd = 0
var even = 0
for i in 0..<inpt.count {
    if(inpt[i] % 2 == 0) {
        even += 1
    } else {
        odd += 1
    }
}

let ans = abs(odd - even)

print(ans)
0