結果

問題 No.99 ジャンピング駒
ユーザー umashikaumashika
提出日時 2016-02-24 22:12:16
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 481 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 20,976 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-23 19:41:39
合計ジャッジ時間 820 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
4,348 KB
testcase_01 AC 14 ms
4,348 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |   scanf("%lld",&n);
      |   ^~~~~~~~~~~~~~~~
main.c:10:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |     scanf("%lld",&x[i]);
      |     ^~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
int main()
{
  long long int n;
  long long int x[100000];
  long long int i;
  long long int count=0;
  scanf("%lld",&n);
  for(i=0;i<n;i++){
    scanf("%lld",&x[i]);
    if(x[i]%2==0){count++;}//偶数ならカウント
  }
  //偶数個の点が与えられているなら、偶数、奇数の数がそれぞれ半分であればよい
  if(n%2==0){
    if(count*2==n){printf("0\n");}
    else{printf("1\n");}
  }
  else{
    printf("1\n");
  }
  return 0;
}

0