結果
| 問題 |
No.104 国道
|
| コンテスト | |
| ユーザー |
mosmos_21
|
| 提出日時 | 2016-10-12 20:20:24 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 202 bytes |
| コンパイル時間 | 429 ms |
| コンパイル使用メモリ | 19,840 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-22 01:51:38 |
| 合計ジャッジ時間 | 1,285 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 16 |
コンパイルメッセージ
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;
}
mosmos_21