結果

問題 No.3044 April Sum of Odd
ユーザー ramia777ramia777
提出日時 2022-04-22 11:18:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,283 bytes
コンパイル時間 1,838 ms
コンパイル使用メモリ 92,932 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-05 20:44:07
合計ジャッジ時間 1,708 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
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 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

//
// Yukicoder
// No.3044 April sum of Odd
//
// 
// 
//





//#include "stdafx.h"
#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>//list
#include <set> //tree
#include <map> //連想配列
#include <unordered_set> //hash
#include <unordered_map> //hash
#include <algorithm>
#include <iomanip>
#include <string>
#include <stdlib.h>


using namespace std;
typedef unsigned long long ULL;
typedef signed long long SLL;
typedef unsigned int UINT;


#define START (0)
#define RIGHT (1)
#define UP    (2)
#define LEFT  (3)
#define DOWN  (4)

#define DATA_MAX (1000000)
#define FMAX(a,b)  ((a)>(b)?(a):(b))
#define FMIN(a,b)  ((a)<(b)?(a):(b))


vector <vector <SLL>> memo2;//二次元可変配列

vector<SLL> memo1;
vector<SLL> c;
vector<SLL> v;
vector<SLL> dp;

SLL H ,A, B, T, F, N, M, Result;

UINT hashtable;




int main(int argc, char *argv[])
{



	SLL a[100000];

	

	cin >> N;
	cin >> M;

	for (int i = 0; i < N; i++)
	{
		cin >> a[i];
	}

	
	SLL sum = 0;
	SLL count = 0;
	for(SLL i=0;i<N;i++)
	{
		if (a[i] % 2)
		{
			sum += a[i];
			count++;
		}
		else
		{
			if (count >= M)
				cout << sum << endl;

			count = 0;
			sum = 0;
		}
	}

	if (count >= M)
		cout <<  sum << endl;

	///////////////////
	cout << endl;
	getchar();
	

	return 0; //end
}

0