Submission
Status:
[PPP][PPP][PPP][PPP][PPP]
Score: 100
User: admin
Problemset: สมดุลย์ชีวิต
Language: cpp
Time: 0.006 second
Submitted On: 2025-03-30 15:47:10
#include <bits/stdc++.h>
using namespace std;
int a,b,N;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> N;
while (N--) {
int x;
cin >> x;
if (x>18) a++;
else b++;
}
if (a<=b) cout << a+b;
else cout << 2*b+(a-b)*2 - 1;
}