結果
| 問題 | No.740 幻の木 | 
| コンテスト | |
| ユーザー |  PicklesSuperior | 
| 提出日時 | 2018-10-19 23:02:20 | 
| 言語 | PHP (843.2) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 122 ms / 2,000 ms | 
| コード長 | 616 bytes | 
| コンパイル時間 | 3,802 ms | 
| コンパイル使用メモリ | 32,144 KB | 
| 実行使用メモリ | 32,660 KB | 
| 最終ジャッジ日時 | 2024-11-18 22:14:08 | 
| 合計ジャッジ時間 | 4,856 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 6 | 
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php
    $input = preg_split('/ /',fgets(STDIN));
    $leaves = $input[0];
    $fall_number = $input[1];
    $start_month = $input[2];
    $wind_period = $input[3];
    $end_month = $start_month + $wind_period - 1;
    $count = 0;
    $this_month = 1;
    while($leaves > 0){
        $count += 1;
        if($start_month <= $this_month && $this_month <= $end_month){
            $leaves -= $fall_number*2;
        }else{
            $leaves -= $fall_number;
        }
        if($this_month == 12){
            $this_month = 1;
        }else{
            $this_month++; 
        }
    }
    print $count . "\n";
?>
            
            
            
        