結果

問題 No.987 N×Mマス計算(基本)
ユーザー MaboyMaboy
提出日時 2021-06-19 18:04:05
言語 Swift
(5.10.0)
結果
WA  
実行時間 -
コード長 488 bytes
コンパイル時間 2,101 ms
コンパイル使用メモリ 135,056 KB
実行使用メモリ 8,640 KB
最終ジャッジ日時 2023-09-05 01:06:09
合計ジャッジ時間 5,196 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 WA -
testcase_06 WA -
testcase_07 RE -
testcase_08 RE -
testcase_09 WA -
testcase_10 RE -
testcase_11 WA -
testcase_12 RE -
testcase_13 WA -
testcase_14 WA -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 WA -
testcase_19 AC 12 ms
8,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let n = readLine()!.split(separator: " ").map{Int($0)!}

var L = [[Int]]()
for _ in 0...n[0]{
    L += [Array(repeating: 0, count: n[1] + 1)]
}

let m = readLine()!.split(separator: " ")
L[0][0] = m[0] == "+" ? -1 : -2
for i in 1...n[0]{
    L[0][i] = Int(m[i])!
}

var v = [Int]()
for i in 1...n[0]{
    L[i][0] += Int(readLine()!)!
    for j in 1...n[1]{
        L[i][j] = L[0][0] == -1 ? L[i][0] + L[0][j] : L[i][0] * L[0][j]
        print(L[i][j],terminator: " ")
    }
    print()
}
0