結果

問題 No.99 ジャンピング駒
ユーザー ゆるくゆるく
提出日時 2014-12-09 23:40:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 254 ms / 5,000 ms
コード長 395 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 21,108 KB
最終ジャッジ日時 2023-09-02 12:21:44
合計ジャッジ時間 2,644 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 252 ms
21,100 KB
testcase_01 AC 254 ms
21,108 KB
testcase_02 AC 250 ms
21,028 KB
testcase_03 AC 252 ms
21,084 KB
testcase_04 AC 249 ms
21,004 KB
testcase_05 AC 250 ms
21,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

n = int(input())
a = [int(i) for i in input().split()]

b = deque([0] * n)

for i,v in enumerate(a):
  b[i] = v % 2

c = b.count(0)
d = b.count(1)

print(abs(c-d))
0