結果
| 問題 |
No.99 ジャンピング駒
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-29 15:32:04 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 263 bytes |
| コンパイル時間 | 1,869 ms |
| コンパイル使用メモリ | 192,380 KB |
| 最終ジャッジ日時 | 2025-01-07 09:58:37 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 5 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:13: warning: ‘n’ is used uninitialized [-Wuninitialized]
10 | while (n--) {
| ~^~
main.cpp:6:9: note: ‘n’ was declared here
6 | int n;
| ^
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n;
int x;
int od=0;
int ev=0;
while (n--) {
cin >> x;
if (x%2) od++;
else ev++;
}
cout << abs(od-ev) << endl;
return 0;
}