Submission #524102


Source Code Expand

Copy
<?php
  $line=fgets(STDIN);
  $arr1=explode(" ",str_replace("\n","",$line));
  /* var_dump($arr1); */
  $area=array();
  for($i=0;$i<$arr1[1];$i++){
    $line=fgets(STDIN);
    $tmp=explode(" ",str_replace("\n","",$line));
    /* var_dump($tmp); */
    $area[$i]=array($tmp[0],$tmp[1]);
  }
  foreach($area as $key1=>$ele1){
    unset($checkarea);
    $checkarea=array_fill($ele1[0],$ele1[1]-$ele1[0]+1,"0");
    foreach($area as $key2=>$ele2){
      if($key1==$key2||$ele2[1]<$ele1[0]||$ele2[0]>$ele1[1])
        continue;
      for($i=$ele2[0];$i<=$ele2[1];$i++){
        if(array_key_exists($i,$checkarea))
          $checkarea[$i]=1;
      }
    }
    $flag=0;
    foreach($checkarea as $ele2){
      if($ele2==0)
        $flag=1;
    }
    if($flag==0)
      $passed[]=$key1+1;
  }
  if(isset($passed)){
    echo count($passed)."\n";
    echo implode("\n",$passed)."\n";
  }
  else
    echo "0\n"
?>

Submission Info

Submission Time
Task A - スペース高橋君
User mamuta
Language PHP (PHP 5.5.21)
Score 0
Code Size 942 Byte
Status
Exec Time 53 ms
Memory 4576 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 example_0.txt, example_1.txt, example_2.txt
All 0 / 100 corner_0.txt, corner_1.txt, corner_2.txt, example_0.txt, example_1.txt, example_2.txt, maxrand_0.txt, maxrand_1.txt, maxrand_2.txt, random_0.txt, random_1.txt, random_2.txt, random_3.txt, random_4.txt
Case Name Status Exec Time Memory
corner_0.txt 53 ms 4576 KB
corner_1.txt 52 ms 4544 KB
corner_2.txt 53 ms 4572 KB
example_0.txt 53 ms 4552 KB
example_1.txt 52 ms 4576 KB
example_2.txt 52 ms 4552 KB
maxrand_0.txt 52 ms 4552 KB
maxrand_1.txt 53 ms 4548 KB
maxrand_2.txt 53 ms 4544 KB
random_0.txt 53 ms 4572 KB
random_1.txt 52 ms 4548 KB
random_2.txt 53 ms 4544 KB
random_3.txt 52 ms 4548 KB
random_4.txt 52 ms 4576 KB