結果
| 問題 |
No.99 ジャンピング駒
|
| コンテスト | |
| ユーザー |
Ysmr_Ry
|
| 提出日時 | 2015-01-05 10:44:50 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 15 ms / 5,000 ms |
| コード長 | 244 bytes |
| コンパイル時間 | 241 ms |
| コンパイル使用メモリ | 23,680 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-13 02:41:25 |
| 合計ジャッジ時間 | 1,194 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf( "%d", &N );
| ~~~~~^~~~~~~~~~~~
main.cpp:14:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
14 | scanf( "%d", &X );
| ~~~~~^~~~~~~~~~~~
ソースコード
#include<cstdio>
#include<cstdlib>
#define rep(i,a) for(int i=0;i<(a);++i)
int main()
{
int N;
scanf( "%d", &N );
int ans = 0;
rep( i, N )
{
int X;
scanf( "%d", &X );
ans += X&1?-1:1;
}
printf( "%d\n", abs(ans) );
return 0;
}
Ysmr_Ry