CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 05:47:28 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=1bf263195386d04c9337711b0043d50f8220b116200fa6e4de5d89efdfca6cc9a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22KzWfy1FYFkIc-aITXoeogMfOTrC3Yuod%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d44d7ace73c1bf-BLR
#include <iostream>#include <iomanip>#include <vector>#include <string># - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <vector>
- #include <string>
- #include <queue>
- #include <map>
- #include <set>
- #include <string>
- #include <algorithm>
- #include <cmath>
- #include <unordered_map>
- #include <unordered_set>
- using namespace std;
- #define ll long long
- #define nl endl
- #define cy cout << "YES\n"
- #define cn cout << "NO\n"
- #define sz s.size()
- #define allv v.begin(), v.end()
- void sherry()
- {
- ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- ll n, m;
- int x1, n1;
- vector<vector<char>> v;
- vector<vector<bool>> vis;
- bool rec(ll h, ll k)
- {
- return h >= n && k >= m && h < 0 && k < 0;
- }
- bool valid(int h, int k)
- {
- if (!rec(h, k) || v[h][k] == '*' || vis[h][k] == 1)
- return false;
- vis[h][k] = 1;
- if (v[h][k] == 'E')
- return true;
- if (valid(h, k + 1))
- return true;
- if (valid(h + 1, k))
- return true;
- if (valid(h, k - 1))
- return true;
- if (valid(h - 1, k))
- return true;
- vis[h][k] = 0;
- return false;
- }
- void solve()
- {
- cin >> n >> m;
- v.resize(n, vector<char>(m));
- vis.resize(n, vector<bool>(m));
- for (int i = 0; i < n; i++)
- {
- for (int j = 0; j < m; j++)
- {
- cin >> v[i][j];
- if (v[i][j] == 'S')
- {
- x1 = i;
- n1 = j;
- }
- }
- }
- if (valid(x1, n1))
- cy;
- else
- cn;
- }
- int main()
- {
- sherry();
- ll t = 1;
- // cin >> t;
- while (t--)
- {
- solve();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐⭐⭐MAKE $1000 INSTANTLY⭐⭐
Java | 1 sec ago | 0.10 KB
-
⭐⭐⭐MAKE $9OO INSTANTLY D M⭐⭐
Java | 5 sec ago | 0.10 KB
-
✅ Make $2500 in 20 minutes⭐⭐⭐ H
JavaScript | 7 sec ago | 0.25 KB
-
⭐⭐⭐Exploit 500$ in 15 Minutes⭐⭐
Java | 7 sec ago | 0.10 KB
-
⭐⭐⭐Exchange Exploit⭐⭐
Java | 13 sec ago | 0.10 KB
-
📌 Swapzone +37% glitch ⭐ 5
JavaScript | 15 sec ago | 0.25 KB
-
⭐⭐⭐Make $15OO in 2O minutesV E⭐⭐
Java | 16 sec ago | 0.10 KB
-
⭐⭐⭐Crypto Accounts⭐⭐
Java | 19 sec ago | 0.10 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand