<?php
$memoryLeng = 0;
$memoryNumber = 0;
for ($i=0; $i<=19; $i++) {
$array{$i}=$random;
}
foreach ($array as $value) {
if ($value == 0) {
$leng++;
$number=$value;
if ($leng > $memoryLeng) { //если длина окажется больше длины в памяти - сохраняем новую длину
$memoryLeng=$leng;
$memoryNumber=$number+1-$memoryLeng;
}
} else {
$leng=0;
}
}
echo "{$memoryLeng}\n {$memoryNumber}";
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7CgokbWVtb3J5TGVuZyA9IDA7CiRtZW1vcnlOdW1iZXIgPSAwOwokYXJyYXkgPSBhcnJheSgpOwpmb3IgKCRpPTA7ICRpPD0xOTsgJGkrKykgewoJJHJhbmRvbSA9IG10X3JhbmQoMCwxKTsKCSRhcnJheXskaX09JHJhbmRvbTsKfQpwcmludF9yKCRhcnJheSk7CmZvcmVhY2ggKCRhcnJheSBhcyAkdmFsdWUpIHsKCWlmICgkdmFsdWUgPT0gMCkgewoJCSRsZW5nKys7CgkJJG51bWJlcj0kdmFsdWU7CgkJaWYgKCRsZW5nID4gJG1lbW9yeUxlbmcpIHsgLy/QtdGB0LvQuCDQtNC70LjQvdCwINC+0LrQsNC20LXRgtGB0Y8g0LHQvtC70YzRiNC1INC00LvQuNC90Ysg0LIg0L/QsNC80Y/RgtC4IC0g0YHQvtGF0YDQsNC90Y/QtdC8INC90L7QstGD0Y4g0LTQu9C40L3RgwoJCQkkbWVtb3J5TGVuZz0kbGVuZzsKCQkJJG1lbW9yeU51bWJlcj0kbnVtYmVyKzEtJG1lbW9yeUxlbmc7CgkJfQoJfSBlbHNlIHsKCQkkbGVuZz0wOwoJfQp9CmVjaG8gInskbWVtb3J5TGVuZ31cbiB7JG1lbW9yeU51bWJlcn0iOwo=