結果

問題 No.402 最も海から遠い場所
ユーザー kotatsugamekotatsugame
提出日時 2016-11-20 01:43:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 437 bytes
コンパイル時間 965 ms
コンパイル使用メモリ 66,676 KB
実行使用メモリ 18,816 KB
最終ジャッジ日時 2024-05-05 10:27:53
合計ジャッジ時間 5,903 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
11,136 KB
testcase_01 AC 7 ms
11,136 KB
testcase_02 AC 7 ms
11,392 KB
testcase_03 AC 7 ms
11,136 KB
testcase_04 AC 7 ms
11,136 KB
testcase_05 AC 6 ms
11,136 KB
testcase_06 AC 6 ms
11,136 KB
testcase_07 AC 6 ms
11,136 KB
testcase_08 AC 7 ms
11,264 KB
testcase_09 WA -
testcase_10 AC 7 ms
11,136 KB
testcase_11 AC 7 ms
11,264 KB
testcase_12 AC 6 ms
11,392 KB
testcase_13 WA -
testcase_14 AC 9 ms
12,160 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
using namespace std;
const int M=1400;
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/2+1<<endl;
	return 0;
}
0