結果

問題 No.99 ジャンピング駒
ユーザー pyraninepyranine
提出日時 2020-12-16 13:48:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 253 bytes
コンパイル時間 1,485 ms
コンパイル使用メモリ 166,544 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 09:30:59
合計ジャッジ時間 2,669 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  int64_t N;
  cin >> N;
  int64_t ans = 0;
  for (int i = 0; i < N; i++) {
    int64_t x;
    cin >> x;
    if (x & 1) ans++;
    else x--;
  }
  cout << max(ans, -ans) << endl;
  return 0;
}
0