結果

問題 No.99 ジャンピング駒
ユーザー PachicobuePachicobue
提出日時 2020-02-04 20:48:32
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 45 ms / 5,000 ms
コード長 292 bytes
コンパイル時間 564 ms
コンパイル使用メモリ 68,116 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 06:33:49
合計ジャッジ時間 1,769 ms
ジャッジサーバーID
(参考情報)
judge10 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
int main()
{
    int N;std::cin >> N;
    int o=0, e=0;
    for(int i = 0; i< N;i++){
        int X;std::cin >> X;
        if(X%2==0){
            e++;
        }else{
            o++;
        }
    }
    std::cout << std::max(o,e)-std::min(o,e)<<std::endl;
    return 0;
}
0