結果

問題 No.99 ジャンピング駒
ユーザー 173205080173205080
提出日時 2019-07-12 09:13:22
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 323 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 28,800 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-28 10:15:44
合計ジャッジ時間 695 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define df 0
#define dist(a,b) (a<b?b-a:a-b) 


int main(){
  int n;
  scanf("%d",&n);
  int i,s[2]={};
  for(i=0;i<n;i++){
    long int a;
    scanf("%ld",&a);
    if(a%2)s[1]++; else s[0]++;
  }
  printf("%d",dist(s[0],s[1]));
  return 0;
}


/// confirm df==0 ///
0