Bear and Shop Trip
Bear Limak is an assistant in the kitchen. While he doesn't really know how to cook, he can run very fast and thus Chef often sends him to buy new ingredients from shops. Chef needs K different ingredients, numbered 1 through K. The kitchen is located at the point (0, 0). There are N shops. The i-th shop is located at the point (Xi, Yi) and its inventory is described by the string si of length K
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start