結果

問題 No.99 ジャンピング駒
ユーザー 👑 testestest
提出日時 2015-08-05 15:01:40
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 151 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 22,016 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-18 03:30:40
合計ジャッジ時間 1,198 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 | scanf("%d",&n);
      | ^~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <math.h>
int main(){
int a,n,s=0;
scanf("%d",&n);
while(n--)scanf("%d",&a)&&a%2?s++:s--;
printf("%d",s>0?s:-s);
return 0;
}
0