結果

問題 No.402 最も海から遠い場所
ユーザー 14番14番
提出日時 2016-09-01 08:35:11
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,905 bytes
コンパイル時間 2,069 ms
コンパイル使用メモリ 113,732 KB
実行使用メモリ 83,380 KB
最終ジャッジ日時 2024-04-27 14:05:50
合計ジャッジ時間 6,267 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
25,352 KB
testcase_01 WA -
testcase_02 AC 27 ms
25,384 KB
testcase_03 AC 27 ms
27,136 KB
testcase_04 AC 27 ms
25,276 KB
testcase_05 AC 27 ms
27,252 KB
testcase_06 AC 27 ms
25,480 KB
testcase_07 AC 27 ms
24,984 KB
testcase_08 AC 26 ms
24,976 KB
testcase_09 AC 27 ms
25,152 KB
testcase_10 AC 26 ms
25,136 KB
testcase_11 AC 27 ms
25,100 KB
testcase_12 AC 27 ms
20,920 KB
testcase_13 AC 28 ms
26,992 KB
testcase_14 AC 29 ms
25,140 KB
testcase_15 AC 33 ms
23,600 KB
testcase_16 AC 38 ms
26,540 KB
testcase_17 AC 140 ms
54,172 KB
testcase_18 AC 237 ms
83,228 KB
testcase_19 AC 135 ms
48,112 KB
testcase_20 AC 242 ms
81,084 KB
testcase_21 AC 209 ms
83,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Generic;
using System.Text;
using System.Linq;


class Program
{
    public void Proc()
    {
        Reader.IsDebug = false;
        int[] inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();

        int h = inpt[0];
        int w = inpt[1];

        char[,] map = new char[h, w];
        int[,] step = new int[h, w];
        int maxHen = 0;
        for (int i = 0; i < inpt[0]; i++)
        {
            string row = Reader.ReadLine();
            for (int j = 0; j < inpt[1]; j++)
            {
                map[i, j] = row[j];
                if (row[j] == '#')
                {
                    int val = 1;
                    if (i == 0 || i == h - 1 || j == 0 || j == w - 1)
                    {
                    }
                    else
                    {
                        val = Math.Min(step[i - 1, j - 1] + 1, Math.Min(step[i, j - 1] + 1, step[i - 1, j] + 1));
                    }
                    step[i, j] = val;
                    maxHen = Math.Max(maxHen, val);
                }
            }
        }

        Console.WriteLine((maxHen + 1) / 2);
    }




    public class Reader
    {
        public static bool IsDebug = true;
        private static String PlainInput = @"


8 8
.#..#...
.######.
#####...
#####.#.
########
######.#
#####...
...####.




";
        private static System.IO.StringReader Sr = null;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (Sr == null)
                {
                    Sr = new System.IO.StringReader(PlainInput.Trim());
                }
                return Sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
    }
    static void Main()
    {
        Program prg = new Program();
        prg.Proc();
    }
}
0