Skip to content

Commit f1943e9

Browse files
committed
Getting an A
1 parent f5ff6fb commit f1943e9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

991B.cpp

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
4+
int main(){
5+
ios_base::sync_with_stdio(false);
6+
cin.tie(NULL);
7+
8+
int n;
9+
cin>>n;
10+
int arr[n], score = 0;
11+
for(int i = 0; i < n; i++){
12+
cin>>arr[i];
13+
score += arr[i];
14+
}
15+
int req_score = ceil(4.5 * n) - score;
16+
sort(arr, arr+n);
17+
int i = 0;
18+
while(req_score > 0){
19+
req_score -= 5 - arr[i];
20+
i++;
21+
}
22+
cout<<i;
23+
}

0 commit comments

Comments
 (0)