Submission #619562
Source Code Expand
<?php
fscanf(STDIN,"%d%d%d",$h,$w,$st);
$ary=array();
for($i=0;$i<$st;$i++){
fscanf(STDIN,"%d%d",$x,$y);
$ary[$i][0]=$x;
$ary[$i][1]=$y;
}
$ang1=$ary[($i+1)/2-1][1]/$ary[($i+1)/2-1][0];
$ang2=$ary[($i+1)/2][1]/$ary[($i+1)/2][0];
$count=0;
for($i=1;$i<$w;$i++){
if($st%2!=0){break;}
if($h/$i < $ang1 and $ang2 < $h/$i){
echo "(".$i.",$h)\n";
$count++;
}
}
//echo $ang1."A";
for($i=1;$i<=$h;$i++){
if($st%2!=0){break;}
if($i/$w < $ang1 and $ang2 < $i/$w){
echo "($w,".$i.")\n";
$count++;
}
}
if($count===0){
echo "-1\n";
}
?>
Submission Info
| Submission Time | |
|---|---|
| Task | B - ケーキ・カッティング (Cake Cutting) |
| User | jtaitan |
| Language | PHP (PHP 5.5.21) |
| Score | 0 |
| Code Size | 670 Byte |
| Status | WA |
| Exec Time | 54 ms |
| Memory | 4496 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 100 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample1.txt, sample2.txt, sample3.txt |
| All | in1.txt, in2.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| in1.txt | WA | 54 ms | 4492 KiB |
| in2.txt | AC | 52 ms | 4480 KiB |
| in3.txt | WA | 51 ms | 4492 KiB |
| in4.txt | AC | 53 ms | 4424 KiB |
| in5.txt | WA | 53 ms | 4492 KiB |
| in6.txt | AC | 51 ms | 4492 KiB |
| in7.txt | AC | 53 ms | 4496 KiB |
| in8.txt | AC | 53 ms | 4496 KiB |
| sample1.txt | AC | 53 ms | 4488 KiB |
| sample2.txt | AC | 54 ms | 4484 KiB |
| sample3.txt | AC | 54 ms | 4420 KiB |