結果

問題 No.99 ジャンピング駒
ユーザー Mcpu3Mcpu3
提出日時 2018-06-28 16:25:09
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 194 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 28,656 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 14:49:17
合計ジャッジ時間 1,334 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
4,380 KB
testcase_01 AC 15 ms
4,380 KB
testcase_02 AC 15 ms
4,376 KB
testcase_03 AC 15 ms
4,376 KB
testcase_04 AC 15 ms
4,376 KB
testcase_05 AC 14 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: 関数 ‘main’ 内:
main.c:13:21: 警告: 関数 ‘abs’ の暗黙的な宣言です [-Wimplicit-function-declaration]
   13 |         printf("%d",abs(o-e));
      |                     ^~~
main.c:3:1: 備考: include ‘<stdlib.h>’ or provide a declaration of ‘abs’
    2 | #include <math.h>
  +++ |+#include <stdlib.h>
    3 | 

ソースコード

diff #

#include <stdio.h>
#include <math.h>

int main(void)
{
	int n,o=0,e=0,t,i;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&t);
		if(t%2)o++;
		else e++;
	}
	printf("%d",abs(o-e));
	return 0;
}
0