結果
| 問題 |
No.99 ジャンピング駒
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-06-28 16:25:09 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 16 ms / 5,000 ms |
| コード長 | 194 bytes |
| コンパイル時間 | 316 ms |
| コンパイル使用メモリ | 29,440 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-30 23:29:34 |
| 合計ジャッジ時間 | 1,381 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
コンパイルメッセージ
main.c: In function 'main':
main.c:13:21: warning: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
13 | printf("%d",abs(o-e));
| ^~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
2 | #include <math.h>
+++ |+#include <stdlib.h>
3 |
ソースコード
#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;
}