結果

問題 No.402 最も海から遠い場所
ユーザー kotatsugamekotatsugame
提出日時 2016-11-20 01:49:56
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 444 ms / 3,000 ms
コード長 437 bytes
コンパイル時間 507 ms
コンパイル使用メモリ 66,868 KB
実行使用メモリ 73,848 KB
最終ジャッジ日時 2023-08-18 04:00:37
合計ジャッジ時間 4,163 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
38,624 KB
testcase_01 AC 10 ms
38,828 KB
testcase_02 AC 12 ms
38,920 KB
testcase_03 AC 11 ms
38,676 KB
testcase_04 AC 11 ms
38,556 KB
testcase_05 AC 10 ms
38,768 KB
testcase_06 AC 11 ms
38,824 KB
testcase_07 AC 11 ms
38,776 KB
testcase_08 AC 12 ms
38,548 KB
testcase_09 AC 12 ms
38,772 KB
testcase_10 AC 10 ms
38,552 KB
testcase_11 AC 12 ms
38,736 KB
testcase_12 AC 11 ms
38,948 KB
testcase_13 AC 14 ms
39,528 KB
testcase_14 AC 13 ms
39,864 KB
testcase_15 AC 25 ms
41,472 KB
testcase_16 AC 30 ms
42,460 KB
testcase_17 AC 241 ms
60,664 KB
testcase_18 AC 444 ms
73,720 KB
testcase_19 AC 415 ms
73,784 KB
testcase_20 AC 442 ms
73,848 KB
testcase_21 AC 423 ms
73,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
using namespace std;
const int M=3000;
int main()
{
	int h,w;cin>>h>>w;
	int c[M+1][M+1],dp[M+1][M+1]={};
	char a;
	for(int i=1;i<=h;i++)for(int j=1;j<=w;j++)
	{
		cin>>a;
		c[i][j]=(a=='#'?0:1);
	}
	int ma=0;
	for(int i=1;i<=h;i++)
	{
		for(int j=1;j<=w;j++)
		{
			if(!c[i][j])dp[i][j]=min(dp[i][j-1],min(dp[i-1][j-1],dp[i-1][j]))+1,ma=max(ma,dp[i][j]);
		}
	}
	cout<<(ma+1)/2<<endl;
	return 0;
}
0