結果

問題 No.99 ジャンピング駒
ユーザー 👑 rin204rin204
提出日時 2020-07-01 14:34:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 521 ms
コンパイル使用メモリ 64,176 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-11 23:58:51
合計ジャッジ時間 1,364 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:19:22: 警告: ‘odd’ may be used uninitialized [-Wmaybe-uninitialized]
   19 |     cout << abs(even - odd) << endl;
      |                 ~~~~~^~~~~
main.cpp:7:18: 備考: ‘odd’ はここで定義されています
    7 |     int n, even, odd;
      |                  ^~~
main.cpp:19:22: 警告: ‘even’ may be used uninitialized [-Wmaybe-uninitialized]
   19 |     cout << abs(even - odd) << endl;
      |                 ~~~~~^~~~~
main.cpp:7:12: 備考: ‘even’ はここで定義されています
    7 |     int n, even, odd;
      |            ^~~~

ソースコード

diff #

#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 ++;
        }
    }
    cout << abs(even - odd) << endl;
    
    return 0;
}
0