Advertisement
a53

paritar

a53
Mar 26th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n,x,i1=-1,p1=-1,i2=1000001,p2=1000001;
  7. ifstream f("paritar.in");
  8. f>>n;
  9. for(int i=1;i<=n;++i)
  10. {
  11. f>>x;
  12. if(x>i1)
  13. i1=x;
  14. if(x>p1)
  15. p1=x;
  16. }
  17. for(int i=n+1;i<=n*2;++i)
  18. {
  19. f>>x;
  20. if(x<i2)
  21. i2=x;
  22. if(x<p2)
  23. p2=x;
  24. }
  25. f.close();
  26. ofstream g("paritar.out");
  27. if(p1<i2&&i1<p2)
  28. g<<"DA";
  29. else
  30. g<<"NU";
  31. g.close();
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement