結果

問題 No.99 ジャンピング駒
ユーザー umashika
提出日時 2016-02-24 22:12:16
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 481 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 20,736 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-22 13:24:34
合計ジャッジ時間 719 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
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