結果

問題 No.722 100×100=1000
ユーザー kerotangkerotang
提出日時 2019-06-03 12:55:55
言語 PHP
(8.3.4)
結果
AC  
実行時間 15 ms / 2,000 ms
コード長 1,391 bytes
コンパイル時間 1,232 ms
コンパイル使用メモリ 18,504 KB
実行使用メモリ 18,952 KB
最終ジャッジ日時 2023-08-28 15:57:31
合計ジャッジ時間 2,350 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
18,848 KB
testcase_01 AC 15 ms
18,944 KB
testcase_02 AC 15 ms
18,920 KB
testcase_03 AC 15 ms
18,952 KB
testcase_04 AC 15 ms
18,808 KB
testcase_05 AC 14 ms
18,808 KB
testcase_06 AC 15 ms
18,688 KB
testcase_07 AC 15 ms
18,868 KB
testcase_08 AC 15 ms
18,936 KB
testcase_09 AC 15 ms
18,924 KB
testcase_10 AC 15 ms
18,660 KB
testcase_11 AC 15 ms
18,932 KB
testcase_12 AC 15 ms
18,860 KB
testcase_13 AC 15 ms
18,676 KB
testcase_14 AC 15 ms
18,800 KB
testcase_15 AC 15 ms
18,920 KB
testcase_16 AC 15 ms
18,848 KB
testcase_17 AC 15 ms
18,816 KB
testcase_18 AC 14 ms
18,916 KB
testcase_19 AC 14 ms
18,684 KB
testcase_20 AC 15 ms
18,944 KB
testcase_21 AC 14 ms
18,860 KB
testcase_22 AC 15 ms
18,920 KB
testcase_23 AC 15 ms
18,880 KB
testcase_24 AC 15 ms
18,904 KB
testcase_25 AC 15 ms
18,852 KB
testcase_26 AC 14 ms
18,872 KB
testcase_27 AC 15 ms
18,816 KB
testcase_28 AC 14 ms
18,888 KB
testcase_29 AC 15 ms
18,868 KB
testcase_30 AC 15 ms
18,800 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();
    }
}

function dentaku($A, $B)
{
    $result = $A * $B;
    if ($result < -99999999 || 99999999 < $result) {
        $result = 'E';
    }
    
    return $result;
}

// 初期化
$sc = new Scanner();
$yukiList = [];
for ($i = 1; $i <= 9; $i++) {
    for ($n = 2; $n < 15; $n++) {
        $yukiList[] = $i * pow(10, $n);
        $yukiList[] = -$i * pow(10, $n);
    }
}

$A = $sc->nextInt();
$B = $sc->nextInt();
if (in_array($A, $yukiList) && in_array($B, $yukiList)) {
    $result = ($A * $B) / 10;
} else {
    $result = dentaku($A, $B);
}


echo $result . "\n";
0