日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

First Grid 枚举(100)

發布時間:2025/3/19 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 First Grid 枚举(100) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.


題意 :

  • 給一個2*2的正方形,每個格子里只有.或者#,保證#數量大于等于2,問是否能從任意#格走到任意#格,只能四方向走

思路 :

  • .的數量小于等于#,所以從.入手
  • .是0,一定可以
  • .是1,一定可以
  • .是2,只有兩種情況不可以
#include <iostream> #include <algorithm> #include <cstring> #include <vector> #include <unordered_set> #include <math.h> #define endl '\n' #define fi first #define se second #define pb push_backusing namespace std; using ll = long long;typedef pair<int, int> PII;int main() {cin.tie(nullptr) -> sync_with_stdio(false);string a, b; cin >> a >> b;if (a[0] == '.' && b[1] == '.' || a[1] == '.' && b[0] == '.') cout << "No" << endl;else cout << "Yes" << endl;return 0; }

總結

以上是生活随笔為你收集整理的First Grid 枚举(100)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。