AlexNeagu11

Untitled

Dec 30th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int f[3000];
  4. int main() {
  5. int n; cin >> n;
  6. for (int i = 1; i <= n; i++) {
  7. int x; cin >> x;
  8. f[x]++;
  9. }
  10. if (f[2020] >= 1) {
  11. cout << "DA\n";
  12. return 0;
  13. }
  14. if (f[1010] >= 1 && f[2] >= 1) {
  15. cout << "DA\n";
  16. return 0;
  17. }
  18. if (f[505] >= 1 && f[4] >= 1) {
  19. cout << "DA\n";
  20. return 0;
  21. }
  22. if (f[505] >= 1 && f[2] >= 2) {
  23. cout << "DA\n";
  24. return 0;
  25. }
  26. if (f[101] >= 1 && f[20] >= 1) {
  27. cout << "DA\n";
  28. return 0;
  29. }
  30. if (f[101] >= 1 && f[5] >= 1 && f[4] >= 1) {
  31. cout << "DA\n";
  32. return 0;
  33. }
  34. if (f[101] >= 1 && f[5] >= 1 && f[2] >= 2) {
  35. cout << "DA\n";
  36. return 0;
  37. }
  38. if (f[101] >= 1 && f[10] >= 1 && f[2] >= 1) {
  39. cout <<"DA\n";
  40. return 0;
  41. }
  42. if (f[202] >= 1 && f[10] >= 1) {
  43. cout << "DA\n";
  44. return 0;
  45. }
  46. if (f[202] >= 1 && f[5] >= 1 && f[2] >= 1) {
  47. cout << "DA\n";
  48. return 0;
  49. }
  50. if (f[404] >= 1 && f[5] >= 1) {
  51. cout << "DA\n";
  52. return 0;
  53. }
  54. cout << "NU\n";
  55. return 0;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment