123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #include "instance.h"
- using namespace std;
- pos::pos(int x, int y) : x(x), y(y) {
- }
- pos::pos() : x(0), y(0) {}
- int pos::dist2(const pos &b) const {
- return x*b.x + y*b.y;
- }
- warehouse::warehouse(pos p, vector<int> disp) : p(p), disp(disp) {
- }
- order::order(int id, pos p, map<int, int> ord) : id(id), p(p), ord(ord) {
- }
- instance::instance() {
- int tmp;
- cin >> row >> col >> drones >> T >> max_load >> P;
- for(int i = 0; i < P; i++) {
- cin >> tmp;
- weights.push_back(tmp);
- }
- cin >> W;
- for(int i = 0; i < W; i++) {
- int x, y;
- vector<int> disp;
- cin >> y >> x;
- for(int j = 0; j < P; j++) {
- cin >> tmp;
- disp.push_back(tmp);
- }
- wh.push_back(warehouse(pos(x, y), disp));
- }
- cin >> C;
- for(int i = 0; i < C; i++) {
- int x, y, L;
- map<int, int> ord;
- cin >> y >> x >> L;
- for(int j = 0; j < L; j++) {
- cin >> tmp;
- ord[tmp]++;
- }
- orders.push_back(order(i, pos(x, y), ord));
- }
- }
|