結果
| 問題 |
No.402 最も海から遠い場所
|
| コンテスト | |
| ユーザー |
Aquarius
|
| 提出日時 | 2019-10-15 16:22:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 261 ms / 3,000 ms |
| コード長 | 574 bytes |
| コンパイル時間 | 1,828 ms |
| コンパイル使用メモリ | 170,084 KB |
| 実行使用メモリ | 56,252 KB |
| 最終ジャッジ日時 | 2024-12-29 17:35:39 |
| 合計ジャッジ時間 | 4,305 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
const short inf = 3e4;
int h, w;
int a[3002][3002];
string s[3002];
int main() {
cin >> h >> w;
s[0] = string(w + 2, '.');
s[h + 1] = string(w + 2, '.');
for (int i = 0; i < h; ++i) {
string t;
cin >> t;
s[i + 1] = '.' + t + '.';
}
int mx = 0;
for (int i = 1; i <= h; ++i) {
for (int j = 1; j <= w; ++j) {
if (s[i][j] == '#') {
a[i][j] = min({ a[i - 1][j - 1], a[i - 1][j], a[i][j - 1] }) + 1;
mx = max(mx, a[i][j]);
}
}
}
cout << (mx + 1) / 2 << endl;
}
Aquarius