結果
| 問題 | No.8044 April Sum of Odd |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-01 22:21:00 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 25 ms / 2,000 ms |
| + 312µs | |
| コード長 | 584 bytes |
| 記録 | |
| コンパイル時間 | 876 ms |
| コンパイル使用メモリ | 181,092 KB |
| 実行使用メモリ | 9,828 KB |
| 最終ジャッジ日時 | 2026-09-30 15:20:21 |
| 合計ジャッジ時間 | 2,620 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size
void mul_mod(ll& a, ll b){
a *= b;
a %= MOD;
}
void add_mod(ll& a, ll b){
a += b;
if(a>MOD){
a -= MOD;
}
}
ll a,s;
int main(void){
int n,m,cnt=0,i;
cin >> n >> m;
for(i=0; i<n; ++i){
cin >> a;
if(a%2){
++cnt;
s += a;
}else{
if(cnt>=m){
cout << s << endl;
}
cnt = 0;
s = 0ll;
}
}
if(cnt>=m){
cout << s << endl;
}
return 0;
}