instance.cpp 961 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #include "instance.h"
  2. using namespace std;
  3. pos::pos(int x, int y) : x(x), y(y) {
  4. }
  5. pos::pos() : x(0), y(0) {}
  6. int pos::dist2(const pos &b) const {
  7. return x*b.x + y*b.y;
  8. }
  9. warehouse::warehouse(pos p, vector<int> disp) : p(p), disp(disp) {
  10. }
  11. order::order(int id, pos p, map<int, int> ord) : id(id), p(p), ord(ord) {
  12. }
  13. instance::instance() {
  14. int tmp;
  15. cin >> row >> col >> drones >> T >> max_load >> P;
  16. for(int i = 0; i < P; i++) {
  17. cin >> tmp;
  18. weights.push_back(tmp);
  19. }
  20. cin >> W;
  21. for(int i = 0; i < W; i++) {
  22. int x, y;
  23. vector<int> disp;
  24. cin >> y >> x;
  25. for(int j = 0; j < P; j++) {
  26. cin >> tmp;
  27. disp.push_back(tmp);
  28. }
  29. wh.push_back(warehouse(pos(x, y), disp));
  30. }
  31. cin >> C;
  32. for(int i = 0; i < C; i++) {
  33. int x, y, L;
  34. map<int, int> ord;
  35. cin >> y >> x >> L;
  36. for(int j = 0; j < L; j++) {
  37. cin >> tmp;
  38. ord[tmp]++;
  39. }
  40. orders.push_back(order(i, pos(x, y), ord));
  41. }
  42. }