5

Interesting REAL life problem !

 11 months ago
source link: https://codeforces.com/blog/entry/116641
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Interesting REAL life problem !

Hello, codeforces!

I'm making a game for a university project, and I faced this problem and thought discussing it on codeforces would be nice because it's somehow related to CP, and shows how CP is useful in real life.

The game is actually about 2 players (Multiplayer game) starting in a room in a house and the goal is to reach another specified room, the house is partitioned into a number of rooms, and each room has colored walls.

  • Each room has at most one hidden gem, and each player can hold at most two gems at the same time.
  • When a player carries a gem of color he can pass through any wall of color (penetrates the wall to the next room).
  • The two players can collaborate and exchange gems with each other if they are in the same room.
  • If a player found a hidden gem in some room, he can either take it if he carries less than 2 gems, or if he had at least one gem, he can exchange it with one of his gems (this operation is reversible and possible any number of times).

My part is to make a levels generator! until now I finished the basic house structure generator, but I'm stuck on generating a valid distribution for gems. I want to generate the MINIMUM number of gems to make the level solvable!

the number of rooms is at most 20 and there are at most 7 colors. (white walls can't be penetrated, so no gems of white color).

what is the best solution you can come up with :) ?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK