結果

問題 No.1133 キムワイプイーター
ユーザー MaboyMaboy
提出日時 2021-06-27 13:21:50
言語 Swift
(5.10.0)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 455 bytes
コンパイル時間 6,486 ms
コンパイル使用メモリ 137,012 KB
実行使用メモリ 22,784 KB
最終ジャッジ日時 2023-09-07 17:20:47
合計ジャッジ時間 6,917 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
8,160 KB
testcase_01 AC 3 ms
8,156 KB
testcase_02 AC 26 ms
12,140 KB
testcase_03 AC 55 ms
17,756 KB
testcase_04 AC 59 ms
18,324 KB
testcase_05 AC 62 ms
18,828 KB
testcase_06 AC 59 ms
18,388 KB
testcase_07 AC 41 ms
14,932 KB
testcase_08 AC 26 ms
11,908 KB
testcase_09 AC 52 ms
17,192 KB
testcase_10 AC 82 ms
22,784 KB
testcase_11 AC 74 ms
21,188 KB
testcase_12 AC 61 ms
18,684 KB
testcase_13 AC 72 ms
21,184 KB
testcase_14 AC 55 ms
18,048 KB
testcase_15 AC 37 ms
14,388 KB
testcase_16 AC 25 ms
12,084 KB
testcase_17 AC 5 ms
8,432 KB
testcase_18 AC 8 ms
8,692 KB
testcase_19 AC 5 ms
8,328 KB
testcase_20 AC 6 ms
8,648 KB
testcase_21 AC 8 ms
8,788 KB
testcase_22 AC 8 ms
8,756 KB
testcase_23 AC 3 ms
8,220 KB
testcase_24 AC 3 ms
8,172 KB
testcase_25 AC 4 ms
8,304 KB
testcase_26 AC 3 ms
8,204 KB
testcase_27 AC 3 ms
8,184 KB
testcase_28 AC 3 ms
8,168 KB
testcase_29 AC 3 ms
8,204 KB
testcase_30 AC 8 ms
8,840 KB
testcase_31 AC 3 ms
8,240 KB
testcase_32 AC 3 ms
8,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let n = readLine()!.split(separator: " ").map{Int($0)!}
let s = Array(readLine()!)
var m = [[String]]()
for _ in 0...n[0]{
    m += [[String](repeating: "1", count: n[0] + 1)]
}
var (x,y) = (0,0)
m[y][x] = "0"
for i in s{
    switch i {
    case "U":
        y += 1
    case "R":
        x += 1
    case "L":
        x -= 1
    default:
        y -= 1
    }
    m[y][x] = "0"

}

for i in (0...n[0]).sorted(by: >){
    print(m[i].joined(separator: " "))
}
0