fork download
  1. #include <vector>
  2. #include <string>
  3.  
  4. class BlockRepresentation
  5. {
  6. private:
  7. class Block
  8. {
  9. public:
  10. int id;
  11. int fpDimensions;
  12. std::vector<int> position; // pointers in question
  13. std::vector<int> blockDimensions; // pointers in question
  14. };
  15. std::vector<Block> all_blocks;
  16. public:
  17. BlockRepresentation() {}
  18. void AddBlock( int id, int fpDimensions, int position[], int dimensions[] );
  19. std::string ToGPL();
  20. };
  21.  
  22. void BlockRepresentation::AddBlock( int id, int fpDimensions, int position[], int dimensions[] )
  23. {
  24. Block newBlock;
  25. newBlock.id = id;
  26. newBlock.fpDimensions = fpDimensions;
  27. newBlock.position = std::vector<int>(position, position + fpDimensions);
  28. newBlock.blockDimensions = std::vector<int>(dimensions, dimensions + fpDimensions);
  29. all_blocks.push_back( newBlock );
  30. }
  31.  
  32. int main()
  33. {
  34. int x[] = {1,2,3,4,5};
  35. int y[] = {2,4,6,8,10};
  36. BlockRepresentation br;
  37. br.AddBlock(1,5,x,y);
  38. br.AddBlock(2,5,y,x);
  39. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
Standard output is empty