I start my solving with two hypotheses: 1. It is enough to use only one inner room. 2. Using this room it is enough edges between two rooms inner and outer consider as edges on boundary of outer room. It typical for contest. You achievements determined by your first quick considerations.
WA6. Not so simple. More rightly to consider functional equation for dist[i,j].This equation solved by method of relaxation as a Laplas equation.
AC at last. The problem indeed very simple and very based on the Floyd. But a man must have big contest experience to catch all logical moments.