+</td></tr><tr><td colspan="2"><h3>Definition</h3></td></tr><tr><td>    </td><td><table><tr><td>Class:</td><td>TeamBuilder</td></tr><tr><td>Method:</td><td>specialLocations</td></tr><tr><td>Parameters:</td><td>vector <string></td></tr><tr><td>Returns:</td><td>vector <int></td></tr><tr><td>Method signature:</td><td>vector <int> specialLocations(vector <string> paths)</td></tr><tr><td colspan="2">(be sure your method is public)</td></tr></table></td></tr><tr><td colspan="2"><h3>Limits</h3></td></tr><tr><td>    </td><td><table><tr><td>Time limit (s):</td><td>2.000</td></tr><tr><td>Memory limit (MB):</td><td>64</td></tr></table></td></tr><tr><td colspan="2"><h3>Constraints</h3></td></tr><tr><td align="center" valign="top">-</td><td><b>paths</b> will contain between 2 and 50 elements, inclusive.</td></tr><tr><td align="center" valign="top">-</td><td>Each element of <b>paths</b> will contain <i>N</i> characters, where <i>N</i> is the number of elements of <b>paths</b>.</td></tr><tr><td align="center" valign="top">-</td><td>Each element of <b>paths</b> will contain only the characters '0' and '1'.</td></tr><tr><td align="center" valign="top">-</td><td>The <i>i</i>-th element of <b>paths</b> will contain a zero in the <i>i</i>-th position.</td></tr><tr><td colspan="2"><h3>Examples</h3></td></tr><tr><td align="center" nowrap="true">0)</td><td></td></tr><tr><td>    </td><td><table><tr><td><table><tr><td><pre>{"010","000","110"}</pre></td></tr></table></td></tr><tr><td><pre>Returns: { 1, 1 }</pre></td></tr><tr><td><table><tr><td colspan="2">Locations 0 and 2 can both reach location 1, and location 2 can reach both of the other locations, so we return {1,1}.</td></tr></table></td></tr></table></td></tr><tr><td align="center" nowrap="true">1)</td><td></td></tr><tr><td>    </td><td><table><tr><td><table><tr><td><pre>{"0010","1000","1100","1000"}</pre></td></tr></table></td></tr><tr><td><pre>Returns: { 1, 3 }</pre></td></tr><tr><td><table><tr><td colspan="2">Only location 3 is able to reach all of the other locations, but it must take more than one path to reach locations 1 and 2. Locations 0, 1, and 2 are reachable by all other locations. The method returns {1,3}.</td></tr></table></td></tr></table></td></tr><tr><td align="center" nowrap="true">2)</td><td></td></tr><tr><td>    </td><td><table><tr><td><table><tr><td><pre>{"01000","00100","00010","00001","10000"}</pre></td></tr></table></td></tr><tr><td><pre>Returns: { 5, 5 }</pre></td></tr><tr><td><table><tr><td colspan="2">Each location can reach one other, and the last one can reach the first, so all of them can reach all of the others.</td></tr></table></td></tr></table></td></tr><tr><td align="center" nowrap="true">3)</td><td></td></tr><tr><td>    </td><td><table><tr><td><table><tr><td><pre>{"0110000","1000100","0000001","0010000","0110000","1000010","0001000"}</pre></td></tr></table></td></tr><tr><td><pre>Returns: { 1, 3 }</pre></td></tr><tr><td></td></tr></table></td></tr></table><p>This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved. </p></body></html>
0 commit comments