結果
問題 | No.99 ジャンピング駒 |
ユーザー |
![]() |
提出日時 | 2016-11-28 17:59:54 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 42 ms / 5,000 ms |
コード長 | 338 bytes |
コンパイル時間 | 801 ms |
コンパイル使用メモリ | 63,104 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 12:40:37 |
合計ジャッジ時間 | 1,933 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
#include <iostream> int main() { int n; std::cin >> n; int cnt_even = 0; int cnt_odd = 0; for(int i = 0; i < n; i++) { int t; std::cin >> t; if(t % 2 == 0) { cnt_even += 1; } else { cnt_odd += 1; } } std::cout << std::abs(cnt_even - cnt_odd) << std::endl; }