結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー kerotangkerotang
提出日時 2019-06-03 12:19:53
言語 PHP
(8.3.4)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 968 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 32,468 KB
実行使用メモリ 32,572 KB
最終ジャッジ日時 2023-10-17 23:16:48
合計ジャッジ時間 1,926 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
32,572 KB
testcase_01 AC 45 ms
32,572 KB
testcase_02 AC 45 ms
32,572 KB
testcase_03 AC 44 ms
32,572 KB
testcase_04 AC 45 ms
32,572 KB
testcase_05 AC 45 ms
32,572 KB
testcase_06 AC 44 ms
32,572 KB
testcase_07 AC 45 ms
32,572 KB
testcase_08 AC 44 ms
32,572 KB
testcase_09 AC 45 ms
32,572 KB
testcase_10 AC 44 ms
32,572 KB
testcase_11 AC 45 ms
32,572 KB
testcase_12 AC 44 ms
32,572 KB
testcase_13 AC 45 ms
32,572 KB
testcase_14 AC 44 ms
32,572 KB
testcase_15 AC 45 ms
32,572 KB
testcase_16 AC 45 ms
32,572 KB
testcase_17 AC 45 ms
32,572 KB
testcase_18 AC 44 ms
32,572 KB
testcase_19 AC 44 ms
32,572 KB
testcase_20 AC 45 ms
32,572 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

class Scanner
{
    private $arr = [];
    private $count = 0;
    private $pointer = 0;

    /**
     * @return mixed
     */
    public function next() {
        if ($this->pointer >= $this->count) {
            $str = trim(fgets(STDIN));
            $this->arr = explode(' ', $str);
            $this->count = count($this->arr);
            $this->pointer = 0;
        }
        $result = $this->arr[$this->pointer];
        $this->pointer++;
        return $result;
    }

    /**
     * @return bool
     */
    public function hasNext() {
        return $this->pointer < $this->count;
    }

    /**
     * @return int
     */
    public function nextInt() {
        return (int)$this->next();
    }

    /**
     * @return float
     */
    public function nextDouble() {
        return (double)$this->next();
    }
}

// 初期化
$sc = new Scanner();
$str = $sc->next();

$time = date('Y/m/d', strtotime('+2 day', strtotime($str)));

echo $time . "\n";
0