結果

問題 No.3850 作門ハッカソン
コンテスト
ユーザー dayo ZOI
提出日時 2026-12-04 22:12:05
言語 C++23(gcc16)
(gcc 16.2.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc16.so -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 424 ms / 2,000 ms
+ 826µs
コード長 2,010 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,769 ms
コンパイル使用メモリ 358,084 KB
実行使用メモリ 9,924 KB
最終ジャッジ日時 2026-12-04 22:12:12
合計ジャッジ時間 5,978 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge6_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <algorithm>
#include <bits/stdc++.h>
#include <csetjmp>
using namespace std;
using ll = long long;
using ld = long double;
using pll = array<ll, 2>;
using vl = vector<ll>;
template <class T> using vec = vector<T>;
template <class T> using vv = vec<vec<T>>;
template <class T> using vvv = vv<vec<T>>;
template <class T> using minpq = priority_queue<T, vector<T>, greater<T>>;
#define all(a) (a).begin(), (a).end()
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define reps(i, l, r) for (ll i = (l); i < (r); ++i)
#define rrep(i, l, r) for (ll i = (r) - 1; i >= (l); --i)
#define sz(x) (ll)(x).size()
template <typename T> bool chmax(T &a, const T &b) {
  return a < b ? a = b, true : false;
}
template <typename T> bool chmin(T &a, const T &b) {
  return a > b ? a = b, true : false;
}

const ll INF = 1LL << 60;

using ull = unsigned long long;
using ulll = __uint128_t;

void solve() {
  // hmm
  // まあ高さ2だけを考えれば良い
  // #####
  // #...#
  // .基準に探すか、#基準に探すか?
  // ?を.にする意味はある?
  // ###? ←ここはどちらにせよ#にすべきだし、
  // #..? ←上が#にできないならここを.にしても意味がない
  // ただ↓は例外か
  // ###
  // #?# とか
  // .を一つ以上確保しつつ、止まったところで考えるなど
  // OK 書く
  ll h, w;
  cin >> h >> w;
  vec<string> s(h);
  rep(i, h) cin >> s[i];
  reps(x, 1, h) {
    reps(y, 1, w-1) {
      if(s[x][y] == '#') continue;
      if(s[x][y-1] == '.') continue;
      if(s[x-1][y] == '.') continue;
      if(s[x-1][y-1] == '.') continue;
      ll k = 1;
      while(y + k < w && s[x][y+k] == '.' && s[x-1][y+k] != '.') k++;
      if(y + k == w) continue;
      if(s[x-1][y+k] == '.') continue;
      cout << "Yes" << endl;
      return;
    }
  }
  cout << "No" << endl;
}

int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(20);

  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
0