Submission #10389597


Source Code Expand

Copy
<?php
$first = trim(fgets(STDIN));
$second = trim(fgets(STDIN));
/*
//$second = trim(fgets(STDIN));  
//$third = trim(fgets(STDIN));  

$a = intval($first);
$bc = explode(" ", $first);
$b = intval($bc[0]);
$c = intval($bc[1]);

//$sum = $a + $b + $c;
$sum = $b * $c;
if ( $sum % 2 == 0 ){
    echo "Even";
} else {
    echo "Odd";
}
$c = substr_count($first, '1');
*/
$c = intval($first);    // 整数の数
$nums = explode(" ", $second);

$nums = conv($nums);

$cnt = 0;
while ($nums) {
    $cnt++;
    $nums = conv($nums);
}

function conv($nums)
{
    $half = array();
    for ($i = 0; $i < count($nums); $i++) {
        $num = intval($nums[$i]);
        if ($num % 2 == 1) {
            return false;
        }

        $half[] = $num;
    }
    return $half;
}

echo $cnt;

Submission Info

Submission Time
Task ABC081B - Shift only
User nishizuka
Language PHP (5.6.30)
Score 0
Code Size 825 Byte
Status
Exec Time 2104 ms
Memory 3576 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample1.txt, sample2.txt, sample3.txt
All 0 / 200 sample1.txt, sample2.txt, sample3.txt, 1.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, sample1.txt, sample2.txt, sample3.txt
Case Name Status Exec Time Memory
1.txt 2104 ms 3576 KB
2.txt 9 ms 3576 KB
3.txt 2104 ms 3576 KB
4.txt 2104 ms 3576 KB
5.txt 2104 ms 3576 KB
6.txt 2104 ms 3576 KB
7.txt 9 ms 3576 KB
sample1.txt 2104 ms 3576 KB
sample2.txt 9 ms 3576 KB
sample3.txt 2104 ms 3576 KB