z56's blog

By z56, history, 8 years ago, translation, In English
<?php
$in_f=fopen('cinemaholics.in', 'r');
$Max=trim(fgets($in_f)); $Mel=trim(fgets($in_f));
fclose($in_f);
$Max=explode(' ', $Max); $Mel=explode(' ', $Mel);
function persTime($pers){ return $pers[0]*3+$pers[1]*20+$pers[2]*120; }
$MaxTime=persTime($Max); $MelTime=persTime($Mel);
if($MaxTime>$MelTime) $out='Max';
elseif($MaxTime<$MelTime) $out='Mel';
else $out='Draw';
$out_f=fopen('cinemaholics.out', 'w');
fputs($out_f, $out.PHP_EOL);
fclose($out_f);

Doesn't works on http://mirror.codeforces.com/gym/101110/problem/A , but nice works in my local PHP CLI.

I read FAQ and it was something about PHP & files & that it 'll not work, but I'm not sure.

  • Vote: I like it
  • +12
  • Vote: I do not like it

| Write comment?
»
8 years ago, # |
Rev. 3   Vote: I like it -29 Vote: I do not like it

[removed]

  • »
    »
    8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    This comment is just hilarious, why are you donwvoting it?