結果

問題 No.722 100×100=1000
ユーザー kerotangkerotang
提出日時 2019-06-03 12:48:57
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 1,350 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 32,276 KB
実行使用メモリ 32,528 KB
最終ジャッジ日時 2024-04-20 16:20:33
合計ジャッジ時間 2,445 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
31,428 KB
testcase_01 AC 40 ms
31,516 KB
testcase_02 AC 41 ms
31,128 KB
testcase_03 WA -
testcase_04 AC 41 ms
31,368 KB
testcase_05 AC 42 ms
31,352 KB
testcase_06 AC 42 ms
31,192 KB
testcase_07 AC 42 ms
31,116 KB
testcase_08 AC 41 ms
31,216 KB
testcase_09 AC 41 ms
31,056 KB
testcase_10 AC 43 ms
31,364 KB
testcase_11 AC 43 ms
31,296 KB
testcase_12 AC 41 ms
30,880 KB
testcase_13 AC 41 ms
31,208 KB
testcase_14 AC 41 ms
31,220 KB
testcase_15 AC 41 ms
31,328 KB
testcase_16 AC 41 ms
31,064 KB
testcase_17 AC 40 ms
31,524 KB
testcase_18 AC 41 ms
31,400 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 39 ms
30,844 KB
testcase_22 AC 40 ms
30,856 KB
testcase_23 AC 40 ms
30,944 KB
testcase_24 AC 40 ms
30,992 KB
testcase_25 AC 40 ms
31,032 KB
testcase_26 AC 41 ms
31,392 KB
testcase_27 AC 41 ms
31,232 KB
testcase_28 AC 41 ms
31,324 KB
testcase_29 AC 42 ms
31,156 KB
testcase_30 AC 43 ms
31,392 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);
    }
}

$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