結果

問題 No.8044 April Sum of Odd
ユーザー nicklaw296
提出日時 2019-04-01 22:19:43
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 380 bytes
コンパイル時間 1,674 ms
コンパイル使用メモリ 167,232 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-27 03:12:00
合計ジャッジ時間 2,379 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

using i64 = int64_t;

int main(){
    int n, m;
    cin >> n >> m;
    i64 sum = 0;
    for(int i=0;i<n;++i){
        i64 a;
        cin >> a;
        if(a % 2){
            sum += a;
        }else if(sum > 0){
            cout << sum << endl;
            sum = 0;
        }
    }
    if(sum > 0)cout << sum << endl;

    return 0;
}
0