Submission

Status:

[PPP][PPP][PPP][PPP][PPP]

Subtask/Task Score:

{20/20}{20/20}{20/20}{20/20}{20/20}

Score: 100

User: SonnyHappy108

Problemset: สมดุลย์ชีวิต

Language: cpp

Time: 0.012 second

Submitted On: 2026-04-11 16:02:23

#include <bits/stdc++.h>
using namespace std;
//done : 11
int main(){
	int n,i;
	cin >> n;
	int a=0,b=0,c;
	for(i=0;i<n;i++){
		cin >> c;
		if (c<=18){
			a++;
		}
		else{
			b++;
		}
	}
	if(b>a){
		cout << b*2-1;
	}
	else{
		cout << a+b;
	}
}