/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB

Code

// Copyright: Mushfiq R.
#include <iostream>
using namespace std;

int main()
{
	long long t, x, n=0, temp=0;
    cin >> t;
	for(int i=0; i<t; i++){
		cin >> x;
		temp += x;
		if(temp%2 == 0){
			n++;
			temp = 0;
		}
	}
	cout << n << endl;
	
	return 0;
}

Information

Submit By
Type
Pretest
Problem
P1042 Array partition
Language
C++20 (G++ 13.2.0)
Submit At
2024-03-27 16:53:40
Judged At
2024-03-27 16:53:40
Judged By
Score
10
Total Time
1ms
Peak Memory
540.0 KiB