@ 2015-12-13T00:28:52Z <?php
//$input = file_get_contents('php://stdin','r');
//$params = explode("\n",$input);
$params = [3,3,60,100];
$probes = array_shift($params);
function silnia($n)
{
return ($n <= 1) ? 1 : gmp_mul($n, silnia($n-1));
}
function z($silnia)
{
$strSilnia = (string)$silnia;
$zeroCount = 0;
for ($i = strlen($strSilnia)-1; $i >= 0; $i--)
{
if ($strSilnia[$i] == 0) $zeroCount += 1;
else break;
}
echo $zeroCount.PHP_EOL;
}
for ($i = 0; $i < $probes; $i++)
{
z(silnia($params[$i]));
}
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 5.6.0 - 5.6.40 , 7.0.0 - 7.0.33 , 7.1.0 - 7.1.33 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.31 , 7.4.0 - 7.4.32 , 8.0.0 - 8.0.12 , 8.0.14 - 8.0.30 , 8.1.0 - 8.1.27 , 8.2.0 - 8.2.17 , 8.3.0 - 8.3.4 0
14
24
Output for 7.3.32 - 7.3.33 , 7.4.33 , 8.0.13 Fatal error: Uncaught Error: Call to undefined function gmp_mul() in /in/14WJV:10
Stack trace:
#0 /in/14WJV(27): silnia(3)
#1 {main}
thrown in /in/14WJV on line 10
Process exited with code 255 . Output for 5.5.0 - 5.5.38 0
0
0
preferences:dark mode live preview
215.96 ms | 401 KiB | 326 Q