結果
| 問題 | No.3850 作門ハッカソン |
| コンテスト | |
| ユーザー |
Iroha_3856
|
| 提出日時 | 2026-12-04 21:42:11 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 476 ms / 2,000 ms |
| + 467µs | |
| コード長 | 1,602 bytes |
| 記録 | |
| コンパイル時間 | 2,436 ms |
| コンパイル使用メモリ | 346,744 KB |
| 実行使用メモリ | 9,920 KB |
| 最終ジャッジ日時 | 2026-12-04 21:42:18 |
| 合計ジャッジ時間 | 6,078 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 29 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for (int i = (l); i < (r); i++)
#define ll long long
#define all(x) (x).begin(), (x).end()
#define siz(x) (int)x.size()
#define debug(x) cout << #x << " : " << endl; for (auto u : x) cout << u << " "; cout << endl
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
const int inf = 1e9;
const ll INF = 4e18;
void solve() {
int H, W; cin >> H >> W;
vector<string> S(H);
rep(i, 0, H) cin >> S[i];
rep(u, 0, H - 1) {
vector<bool> match_side(W, true), match_bet(W, true);
rep(i, 0, W) {
if (S[u][i] == '.') match_side[i] = match_bet[i] = false;
}
int d = u + 1;
rep(i, 0, W) {
if (S[d][i] == '.') match_side[i] = false;
if (S[d][i] == '#') match_bet[i] = false;
}
vector<int> S(W + 1);
S[0] = 0;
rep(i, 0, W) S[i + 1] = S[i] + match_bet[i];
vector<int> oks;
rep(i, 0, W) {
if (match_side[i]) oks.push_back(i);
}
int n = siz(oks);
rep(i, 0, n) {
for (int j = i + 1; j < n; j++) {
if (oks[j] == oks[i] + 1) continue;
if (S[oks[j]] - S[oks[i] + 1] == oks[j] - oks[i] - 1) {
cout << "Yes\n";
return;
}
break;
}
}
}
cout << "No\n";
}
int main() {
int T; cin >> T;
while(T--) solve();
}
Iroha_3856