結果
問題 |
No.8044 April Sum of Odd
|
ユーザー |
![]() |
提出日時 | 2019-04-01 21:21:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 530 bytes |
コンパイル時間 | 580 ms |
コンパイル使用メモリ | 72,680 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-26 10:49:49 |
合計ジャッジ時間 | 1,160 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 3 WA * 7 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <cstdio> #include <cstring> #include <cmath> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; ll s = 0; for (int i = 0; i < n; i++) { int a; cin >> a; if (a % 2) { s += a; } else if (s) { cout << s << '\n'; s = 0; } } if (s) cout << s << '\n'; return 0; }