結果
問題 | No.99 ジャンピング駒 |
ユーザー |
![]() |
提出日時 | 2016-10-12 18:50:55 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 16 ms / 5,000 ms |
コード長 | 202 bytes |
コンパイル時間 | 835 ms |
コンパイル使用メモリ | 20,096 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 01:29:46 |
合計ジャッジ時間 | 995 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d" ,&n); | ^~~~~~~~~~~~~~~ main.c:10:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d", &i); | ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>int main(){int i, n, s = 0;scanf("%d" ,&n);while(n > 0){scanf("%d", &i);i % 2 ? s++ : s--;n--;}if(s < 0) s *= -1;printf("%d\n", s);return 0;}