結果
問題 | No.99 ジャンピング駒 |
ユーザー | suppy193 |
提出日時 | 2015-06-04 13:26:49 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 15 ms / 5,000 ms |
コード長 | 238 bytes |
コンパイル時間 | 241 ms |
コンパイル使用メモリ | 24,436 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-20 19:08:39 |
合計ジャッジ時間 | 964 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 15 ms
4,376 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 | 15 ms
4,376 KB |
コンパイルメッセージ
main.c: In function ‘main’: main.c:12:17: warning: implicit declaration of function ‘abs’ [-Wimplicit-function-declaration] printf("%d\n", abs(even - odd)); ^~~
ソースコード
#include <stdio.h> #include <math.h> int main(void) { int i, N, X, odd = 0, even = 0; scanf("%d", &N); for(i = 1;i <= N;i++){ scanf("%d", &X); if(X % 2 == 0)even++; else odd++; } printf("%d\n", abs(even - odd)); return 0; }