結果

問題 No.987 N×Mマス計算(基本)
ユーザー takutakutakutaku
提出日時 2021-06-28 08:58:36
言語 PHP
(8.3.4)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 445 bytes
コンパイル時間 713 ms
コンパイル使用メモリ 18,568 KB
実行使用メモリ 19,020 KB
最終ジャッジ日時 2023-09-07 18:13:52
合計ジャッジ時間 2,489 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
18,904 KB
testcase_01 AC 15 ms
18,932 KB
testcase_02 AC 23 ms
18,912 KB
testcase_03 AC 17 ms
18,952 KB
testcase_04 AC 21 ms
19,020 KB
testcase_05 AC 20 ms
18,860 KB
testcase_06 AC 23 ms
18,904 KB
testcase_07 AC 19 ms
18,896 KB
testcase_08 AC 16 ms
18,968 KB
testcase_09 AC 16 ms
18,908 KB
testcase_10 AC 16 ms
18,960 KB
testcase_11 AC 23 ms
18,928 KB
testcase_12 AC 25 ms
18,796 KB
testcase_13 AC 18 ms
18,984 KB
testcase_14 AC 15 ms
18,824 KB
testcase_15 AC 19 ms
18,720 KB
testcase_16 AC 26 ms
18,928 KB
testcase_17 AC 23 ms
19,000 KB
testcase_18 AC 26 ms
18,940 KB
testcase_19 AC 31 ms
18,992 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
    
    $n = explode(" ",trim(fgets(STDIN)));
    $b = explode(" ",trim(fgets(STDIN)));
    $op = $b[0];
    
    for($i = 0;$i < $n[0];$i++) {
        $a = trim(fgets(STDIN));
        
        for($k = 1; $k <= $n[1]; $k++) {
            if($op == "+") {
                echo ((int)$a + (int)$b[$k])." ";
            }else {
                echo ((int)$a * (int)$b[$k])." ";
            }
        }
        
        echo "\n";

    }
?>
0