結果
| 問題 | No.99 ジャンピング駒 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-01 14:33:17 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 463 bytes |
| 記録 | |
| コンパイル時間 | 364 ms |
| コンパイル使用メモリ | 71,920 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-04 08:50:42 |
| 合計ジャッジ時間 | 1,036 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 4 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:13:18: warning: 'even' may be used uninitialized [-Wmaybe-uninitialized]
13 | even ++;
| ~~~~~^~
main.cpp:7:12: note: 'even' was declared here
7 | int n, even, odd;
| ^~~~
main.cpp:16:17: warning: 'odd' may be used uninitialized [-Wmaybe-uninitialized]
16 | odd ++;
| ~~~~^~
main.cpp:7:18: note: 'odd' was declared here
7 | int n, even, odd;
| ^~~
ソースコード
#include <iostream>
#include<string>
using namespace std;
using ll = long long int;
int main(void){
int n, even, odd;
cin >> n;
ll x;
for (int i = 0; i < n; i ++){
cin >> x;
if (x % 2 == 0){
even ++;
}
else{
odd ++;
}
}
if (even * odd == 0){
cout << n;
}
else if (n % 2 == 0){
cout << 0;
}
else{
cout << 1;
}
return 0;
}