結果

問題 No.99 ジャンピング駒
ユーザー lunnearlunnear
提出日時 2019-02-04 03:46:37
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 385 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 25,684 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-25 00:57:04
合計ジャッジ時間 1,009 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n;
    scanf("%d", &n);
    
    int evn = 0;    
    int odd = 0;
    
    int in;
    
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &in);
        
        if((in % 2) == 0)
            evn++;
        else
            odd++;
    }
    
    int ans = abs(evn - odd);
    
    printf("%d\n", ans);
    return 0;
}
0