結果

問題 No.3044 April Sum of Odd
ユーザー ramia777ramia777
提出日時 2022-04-22 11:28:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 1,287 bytes
コンパイル時間 835 ms
コンパイル使用メモリ 93,592 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 20:54:53
合計ジャッジ時間 1,526 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 4 ms
4,376 KB
testcase_04 AC 5 ms
4,380 KB
testcase_05 AC 5 ms
4,380 KB
testcase_06 AC 6 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 3 ms
4,380 KB
testcase_09 AC 5 ms
4,380 KB
testcase_10 AC 37 ms
4,380 KB
testcase_11 AC 16 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

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