- /// OmShantihari
- /// Author: Sujan Mridha
- /// CSE 5th batch, University of Barishal
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int main ()
- {
- int i,n,m,b,c,s,a[200];
- cin>>n;
- for (i=0,s=0;i<n;i++)
- {
- cin>>a[i];
- s+=a[i];
- }
- sort (a,a+n);
- s/=2;
- for (i=n-1,c=0,b=0;i>=0;b++,i--)
- {
- c+=a[i];
- if (c>s) break;
- }
- cout<<++b<<endl;
- return 0;
- }
Tuesday, January 21, 2020
Codeforces 160A Twins Solution in C
Subscribe to:
Post Comments (Atom)
Codeforces 131A cAPS lOCK Solution in C
#include <stdio.h> int main () { char ch [ 106 ]; int i , j , ck = 1 ; scanf ( "%s" , ch ); ...
-
#include <stdio.h> #include <string.h> int main () { int i , n , l = 0 ; char a [ 120 ]; scanf ( ...
-
#include <stdio.h> int main () { int o , n , a , b , c , s , t , u ; s = 0 ; t = 0 ; u = 0 ...
-
#include <stdio.h> #include <string.h> int main () { int i , n , p = 0 ; char s [ 120 ]; scanf ( ...
No comments:
Post a Comment