Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Vertex
- {
- int x, y, id, comp;
- Vertex(int x, int y, int id)
- :x(x), y(y), id(id)
- {}
- };
- struct Line
- {
- vector<Vertex> *arr;
- bool swapped = false;
- Vertex first()
- {
- Vertex v = (swapped ? (*arr)[arr->size() - 1] : (*arr)[0]);
- cout << "first" << v.x << ' ' << v.y << endl;
- return v;
- }
- Vertex last()
- {
- Vertex v = swapped ? (*arr)[0] : (*arr)[arr->size() - 1];
- cout << "last" << v.x << ' ' << v.y << endl;
- return v;
- }
- Line(vector<Vertex> *narr, bool x)
- {
- if (narr->size() < 2)
- {
- cout << "noooo!";
- while (1);
- }
- arr = narr;
- }
- };
- int main()
- {
- //just piece
- vector<vector<Vertex>> stupid;
- //fill stupid
- vector<Line> smart;
- for (vector<Vertex> vv : stupid)
- {
- //cout << vv.size() << endl;
- if (vv.size() >= 2)
- {
- //cout << tostr(vv);
- Line l(&vv, true);
- cout << l.arr->size() << endl;
- smart.push_back(l);
- cout << smart[smart.size() - 1].arr->size();
- }
- }
- for (int i = 0; i < smart.size(); ++i)
- cout << smart[i].arr->size() << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement