fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int MAX_SIZE = 10;
  5.  
  6. int main() {
  7. int n, v[MAX_SIZE + 1];
  8. cin >> n;
  9. int flag = 1;
  10. for (int i = 1; i <= n * 2; ++i) {
  11. if (i <= n) {
  12. cin >> v[i];
  13. } else {
  14. int currentEl;
  15. cin >> currentEl;
  16. if (v[i - n] == currentEl) {
  17. flag = 0;
  18. }
  19. }
  20. }
  21. if (flag == 0) {
  22. cout << "NU";
  23. } else {
  24. cout << "DA";
  25. }
  26. return 0;
  27. }
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
DA