結果
| 問題 |
No.8044 April Sum of Odd
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2019-04-01 23:03:06 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 503 bytes |
| コンパイル時間 | 418 ms |
| コンパイル使用メモリ | 59,948 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-27 04:03:36 |
| 合計ジャッジ時間 | 1,010 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 1 WA * 9 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n,m;cin>>n>>m;
int nw = 0;
long long wa = 0;
vector<int> arr;
for(int i = 0; n > i; i++){
int tmp;cin>>tmp;
if(tmp % 2 == 1){
nw++;
wa += tmp;
}else{
if(nw >= m){
arr.push_back(wa);
}
wa = 0;
nw = 0;
}
}
for(int i = 0; arr.size() > i; i++){
cout << arr[i] << endl;
}
}