結果

問題 No.402 最も海から遠い場所
ユーザー kotatsugamekotatsugame
提出日時 2016-11-20 01:49:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 514 ms / 3,000 ms
コード長 437 bytes
コンパイル時間 513 ms
コンパイル使用メモリ 68,604 KB
実行使用メモリ 73,808 KB
最終ジャッジ日時 2024-05-05 10:28:19
合計ジャッジ時間 4,335 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
38,656 KB
testcase_01 AC 25 ms
38,656 KB
testcase_02 AC 18 ms
38,912 KB
testcase_03 AC 24 ms
38,656 KB
testcase_04 AC 25 ms
38,656 KB
testcase_05 AC 19 ms
38,656 KB
testcase_06 AC 25 ms
38,528 KB
testcase_07 AC 18 ms
38,656 KB
testcase_08 AC 27 ms
38,656 KB
testcase_09 AC 25 ms
38,784 KB
testcase_10 AC 18 ms
38,656 KB
testcase_11 AC 25 ms
38,912 KB
testcase_12 AC 19 ms
38,912 KB
testcase_13 AC 29 ms
39,424 KB
testcase_14 AC 20 ms
39,680 KB
testcase_15 AC 40 ms
41,472 KB
testcase_16 AC 40 ms
42,368 KB
testcase_17 AC 291 ms
60,672 KB
testcase_18 AC 498 ms
73,808 KB
testcase_19 AC 504 ms
73,680 KB
testcase_20 AC 514 ms
73,800 KB
testcase_21 AC 511 ms
73,676 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