You are viewing a single comment's thread. Return to all comments →
php solution
<?php $handle = fopen ("php://stdin","r"); fscanf($handle,"%d",$n); $file = array_map("intval", explode(" ",fgets($handle))); $i = 0; $s = 0; while($i < $n) { $i += ($file[$i] + 1); $s++; } echo $s; ?>
Seems like cookies are disabled on this browser, please enable them to open this website
Recover the Arrays
You are viewing a single comment's thread. Return to all comments →
php solution