結果
問題 | No.3044 April Sum of Odd |
ユーザー | Raff |
提出日時 | 2022-03-07 15:37:22 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 481 bytes |
コンパイル時間 | 1,420 ms |
コンパイル使用メモリ | 167,752 KB |
実行使用メモリ | 4,500 KB |
最終ジャッジ日時 | 2023-09-29 16:24:04 |
合計ジャッジ時間 | 2,822 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,384 KB |
testcase_02 | AC | 1 ms
4,376 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 16 ms
4,380 KB |
testcase_12 | AC | 1 ms
4,380 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int N, M; cin >> N >> M; vector<int> A(N); for (auto &a : A) cin >> a; A.push_back(0); int cnt = 0, tot = 0; for (auto &a : A) { if (a & 1 == 1) { cnt++; tot += a; } else { if (cnt >= M) cout << tot << endl; cnt = 0; tot = 0; } } }