結果

問題 No.99 ジャンピング駒
ユーザー 313makoto0313makoto0
提出日時 2014-12-23 17:04:15
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 275 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 23,308 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-09-02 21:41:23
合計ジャッジ時間 991 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<stdio.h>

int main()
{
  int x,ans=0,i,N;

  scanf("%d",&N);

  for (i=0;i<N;i++) {
    scanf("%d",&x);
    if (x%2==0) {
      ans++;
    } else {
      ans--;
    }
  }

  if (ans>0) {
    printf("%d\n",ans);
  } else {
    printf("%d\n",-ans);
  }

  return 0;
}
0