Tên đăng nhập Điểm ▾ Bài tập Giới thiệu
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0

hhhhhhhhhhhhhhhhhhhh

31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0

dd

31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0

ko

31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0

include <bits/stdc++.h>

using namespace std;
int compare(const void a,const void *b)
{
return(
(int)a-(int)b);
}
int v ;
int recur(int a[], int i, int curS,int sum)
{
if (i == 0) return abs((sum - curS)-curS);
else if(recur(a, i-1, curS + a[i-1],sum)==recur(a, i-1, curS, sum)) v=recur(a, i-1, curS, sum) ;
/

{
cout<<recur(a, i-1, curS + a[i-1],sum)<<" ";
cout<<recur(a, i-1, curS, sum)<<endl; }*/ return v; } int main() { static int i,sum,n,a[10000]; while (cin>>n)
{
for (i = 0; i < n; i++)
{
cin >> a[i];
sum += a[i];
}
qsort(a,n,sizeof(int),compare) ;
cout<<recur(a, n, 0, sum)<<endl;
v=0;
}
}

31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0

Nothing but u

31301 0 0
31301 0 0
31301 0 0
31301 0 0
31301 0 0