結果

問題 No.1133 キムワイプイーター
ユーザー keymoon
提出日時 2021-01-15 00:25:57
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 986 bytes
コンパイル時間 2,938 ms
コンパイル使用メモリ 113,124 KB
実行使用メモリ 32,536 KB
最終ジャッジ日時 2024-11-24 20:01:48
合計ジャッジ時間 4,246 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 8 WA * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;

public static class P
{
    public static void Main()
    {
        var nm = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var n = nm[0];
        var m = nm[1];
        var map = Enumerable.Repeat(0, n + 1).Select(_ => Enumerable.Repeat(1, n + 1).ToArray()).ToArray();
        var (y, x) = (0, 0);
        map[y][x] = 0;
        foreach (var c in Console.ReadLine())
        {
            if (c == 'R') x++;
            if (c == 'L') x--;
            if (c == 'U') y++;
            if (c == 'D') y--;
            y = Clamp(y, 0, n);
            x = Clamp(x, 0, n);
            map[y][x] = 0;
        }

        Console.WriteLine(string.Join("\n", map.Select(x => string.Join(" ", x))));
    }
}
0