Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int n, x, xmax;
- long long s;
- int main()
- {
- cin>>n;
- for(int i=1; i<=n; ++i)
- {
- cin>>x;
- s+=x;
- xmax=max(xmax,x);
- }
- if(s-xmax > xmax)
- cout<<"DA";
- else
- cout<<"NU";
- return 0;
- }
- /**
- SO
- #include <iostream>
- using namespace std;
- long long v[1000001];
- int main()
- {
- long long s=0,n,maxx=0;
- cin>>n;
- for(int i=1;i<=n;i++)
- cin>>v[i],s+=v[i],maxx=max(maxx,v[i]);
- if(s-maxx>maxx)
- cout<<"DA";
- else
- cout<<"NU";
- return 0;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement