Advertisement
a53

Poligon

a53
Jul 29th, 2021
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. int n, x, xmax;
  5. long long s;
  6. int main()
  7. {
  8. cin>>n;
  9. for(int i=1; i<=n; ++i)
  10. {
  11. cin>>x;
  12. s+=x;
  13. xmax=max(xmax,x);
  14. }
  15. if(s-xmax > xmax)
  16. cout<<"DA";
  17. else
  18. cout<<"NU";
  19. return 0;
  20. }
  21. /**
  22. SO
  23. #include <iostream>
  24. using namespace std;
  25. long long v[1000001];
  26. int main()
  27. {
  28. long long s=0,n,maxx=0;
  29. cin>>n;
  30. for(int i=1;i<=n;i++)
  31. cin>>v[i],s+=v[i],maxx=max(maxx,v[i]);
  32. if(s-maxx>maxx)
  33. cout<<"DA";
  34. else
  35. cout<<"NU";
  36. return 0;
  37. }
  38. */
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement