結果
問題 |
No.722 100×100=1000
|
ユーザー |
![]() |
提出日時 | 2019-06-03 12:48:57 |
言語 | PHP (843.2) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,350 bytes |
コンパイル時間 | 5,711 ms |
コンパイル使用メモリ | 30,780 KB |
実行使用メモリ | 31,576 KB |
最終ジャッジ日時 | 2024-10-12 12:07:48 |
合計ジャッジ時間 | 3,013 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 25 WA * 2 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?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";