fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <vector>
  4. #include <utility>
  5.  
  6. struct Point
  7. {
  8. Point(int x = 0, int y = 0):
  9. x(x), y(y)
  10. {}
  11.  
  12. int x, y;
  13. };
  14.  
  15. std::vector<Point> &&getPoints()
  16. {
  17. std::vector<Point> result;
  18. for (int i = 0; i < 10; ++i) {
  19. result.push_back(Point(i, i));
  20. }
  21. return std::move(result);
  22. }
  23.  
  24. int main(int argc, char *argv[])
  25. {
  26. auto points = getPoints();
  27. for (Point p: points) {
  28. std::cout << p.x << ' ' << p.y << std::endl;
  29. }
  30.  
  31. return 0;
  32. }
  33.  
Time limit exceeded #stdin #stdout #stderr 5s 3432KB
stdin
Standard input is empty
stdout
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
stderr
*** Error in `./prog': corrupted double-linked list: 0x09b1b050 ***