結果
問題 | No.99 ジャンピング駒 |
ユーザー |
|
提出日時 | 2016-11-30 16:40:02 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 14 ms / 5,000 ms |
コード長 | 222 bytes |
コンパイル時間 | 153 ms |
コンパイル使用メモリ | 20,480 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-27 14:00:11 |
合計ジャッジ時間 | 717 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d",&n); | ^~~~~~~~~~~~~~ main.c:7:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d",&x); | ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>int main(void) {int k[2] = {0},x,n,i,r;scanf("%d",&n);for(i = 1;i <= n;i++){scanf("%d",&x);if(x < 0){x*=-1;}k[x%2]++;}r = k[0]-k[1];if(r < 0){r*=-1;}printf("%d\n",r);return 0;}