Advertisement
Guest User

Untitled

a guest
Oct 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. #include <utility>
  5. using namespace std;
  6.  
  7. int x1, x2, y3, y2, zbr, n;
  8.  
  9. struct kocka {
  10. int xp ,xk ,y , lok;
  11. } lego;
  12.  
  13. bool komp1(kocka a, kocka b)
  14. {
  15. return a.y<b.y;
  16. }
  17.  
  18. vector <kocka> gs, ds;
  19.  
  20. int main()
  21. {
  22. cin >> n;
  23. for (int i=0;i<n;i++) {
  24. cin >> x1 >> y3 >> x2 >> y2;
  25. lego.xp=x1;
  26. lego.xk=x2;
  27. lego.y=y3;
  28. lego.lok=i;
  29. ds.push_back(lego);
  30. lego.xp=x1;
  31. lego.xk=x2;
  32. lego.y=y2;
  33. lego.lok=i;
  34. gs.push_back(lego);
  35. }
  36.  
  37. sort(ds.begin(),ds.end(),komp1);
  38. sort(gs.begin(),gs.end(),komp1);
  39.  
  40.  
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement