結果

問題 No.402 最も海から遠い場所
ユーザー maimai
提出日時 2017-09-08 23:38:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 115 ms / 3,000 ms
コード長 1,243 bytes
コンパイル時間 1,987 ms
コンパイル使用メモリ 193,900 KB
実行使用メモリ 65,536 KB
最終ジャッジ日時 2024-04-25 02:40:47
合計ジャッジ時間 3,526 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 3 ms
5,376 KB
testcase_14 AC 3 ms
5,760 KB
testcase_15 AC 9 ms
8,832 KB
testcase_16 AC 10 ms
10,112 KB
testcase_17 AC 85 ms
37,248 KB
testcase_18 AC 115 ms
65,536 KB
testcase_19 AC 46 ms
18,432 KB
testcase_20 AC 107 ms
65,536 KB
testcase_21 AC 100 ms
65,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
typedef unsigned int uint;
typedef long long int ll;
typedef unsigned long long int ull;

#define debugv(v) printf("L%d %s => ",__LINE__,#v);for(auto e:v){cout<<e<<" ";}cout<<endl;
#define debugm(m) printf("L%d %s is..\n",__LINE__,#m);for(auto v:m){for(auto e:v){cout<<e<<" ";}cout<<endl;}
#define debuga(m,w) printf("L%d %s is => ",__LINE__,#m);for(int x=0;x<(w);x++){cout<<(m)[x]<<" ";}cout<<endl;
#define debugaa(m,w,h) printf("L%d %s is..\n",__LINE__,#m);for(int y=0;y<(h);y++){for(int x=0;x<(w);x++){cout<<(m)[x][y]<<" ";}cout<<endl;}
#define ALL(v) (v).begin(),(v).end()
#define BIGINT 0x7FFFFFFF
#define E107 1000000007

template<typename T1,typename T2>
ostream& operator <<(ostream &o,const pair<T1,T2> p){o<<"("<<p.first<<":"<<p.second<<")";return o;}

int h,w;
char maze[5000][5000];
int dp[5005][5005];

int main(){
    int i,j,k,l;
    
    int maxi=0;
    cin>>h>>w;cin.ignore();
    
    for (i=1;i<=h;i++){
        scanf("%s",maze[i]);//gets(maze[i]);
        for (j=0;j<w;j++){
            if (maze[i][j]=='#'){
                maxi=max(dp[i][j]=min(dp[i-1][j-1],min(dp[i-1][j],dp[i][j-1]))+1,maxi);
            }
        }
    }
    
    cout<<(maxi+1)/2<<endl;


    return 0;
}
0