当前位置: 首页 > news >正文

如何做一名合格的网站巡查下载app到手机上并安装

如何做一名合格的网站巡查,下载app到手机上并安装,杂志社网站建设,制作二维码网站免费一、题目 1、题目描述 2、输入输出 2.1输入 2.2输出 3、原题链接 https://codeforces.com/problemset/problem/196/B 二、解题报告 1、思路分析 考虑如何判断一条路径可以无限走? 我们对朴素的网格dfs改进,改进为可以dfs网格外的区域 如果存在某个…

一、题目

1、题目描述

2、输入输出

2.1输入

2.2输出

3、原题链接

https://codeforces.com/problemset/problem/196/B


二、解题报告

1、思路分析

考虑如何判断一条路径可以无限走?

我们对朴素的网格dfs改进,改进为可以dfs网格外的区域

如果存在某个 位置 (i % n, j % m) 被访问两次,并且两次的(i, j)不同,则说明进入了一条路径的循环,合法。

2、复杂度

时间复杂度: O(NM)空间复杂度:O(NM)

3、代码详解

 ​
#include <bits/stdc++.h>
// #include <ranges>
// #define DEBUG
using i64 = long long;
using u32 = unsigned;
using u64 = unsigned long long;
constexpr int inf32 = 1E9 + 7;
constexpr i64 inf64 = 1E18 + 7;
constexpr double eps = 1e-9;struct DSU {std::vector<int> p;int n;DSU(int _n) : p(_n, -1), n(_n) {}void init () {p.assign(n, -1);}int find(int x) {return p[x] < 0 ? x : p[x] = find(p[x]);}void merge(int x, int y) {int px = find(x), py = find(y);if (px == py) return;if (p[px] > p[py]) std::swap(px, py);p[px] += p[py], p[py] = px;}int size(int x) {return -p[find(x)];}
};constexpr int dir[5] = { -1, 0, 1, 0, -1 };void solve() {int n, m;std::cin >> n >> m;std::vector<std::string> g(n);for (int i = 0; i < n; ++ i) std::cin >> g[i];if (n == 1 && m == 1) {std::cout << "Yes";return;}int stx, sty;for (int i = 0; i < n; ++ i)for (int j = 0; j < m; ++ j) if (g[i][j] == 'S') {stx = i, sty = j;break;}auto pos = [&m](int i, int j) {return i * m + j;};std::vector<std::pair<int, int>> st, vis(n * m, { inf32, inf32 });st.emplace_back(stx, sty);vis[pos(stx, sty)] = { stx, sty };while (st.size()) {auto [x, y] = st.back();st.pop_back();for (int k = 0; k < 4; ++ k) {auto [nx, ny] = std::pair(x + dir[k], y + dir[k + 1]);auto [nnx, nny] = std::pair(((nx % n) + n) % n, ((ny % m) + m) % m);// assert(nnx >= 0 && nnx < n);// assert(nny >= 0 && nny < m);if (g[nnx][nny] != '#') {if (vis[pos(nnx, nny)].first < inf32) {if(vis[pos(nnx, nny)] != std::pair(nx, ny)) {std::cout << "Yes";return;}}else {vis[pos(nnx, nny)] = { nx, ny };st.emplace_back(nx, ny);}}}}std::cout << "No";
}auto FIO = []{std::ios::sync_with_stdio(false);std::cin.tie(nullptr);std::cout.tie(nullptr);return 0;
} ();int main() {#ifdef DEBUGfreopen("in.txt", "r", stdin);freopen("out.txt", "w", stdout);#endif     int t = 1;// std::cin >> t;while (t --)solve();return 0;
}


文章转载自:
http://leavening.wqfj.cn
http://peau.wqfj.cn
http://exhale.wqfj.cn
http://agouti.wqfj.cn
http://neutralise.wqfj.cn
http://guttle.wqfj.cn
http://autokinesis.wqfj.cn
http://saktism.wqfj.cn
http://anbury.wqfj.cn
http://oversophisticate.wqfj.cn
http://actuator.wqfj.cn
http://lacrimal.wqfj.cn
http://glycogenesis.wqfj.cn
http://windbreak.wqfj.cn
http://thyroxin.wqfj.cn
http://mouthpiece.wqfj.cn
http://nevadan.wqfj.cn
http://scrutator.wqfj.cn
http://skene.wqfj.cn
http://craniologist.wqfj.cn
http://shapable.wqfj.cn
http://chemosphere.wqfj.cn
http://watchband.wqfj.cn
http://gremmie.wqfj.cn
http://liquidity.wqfj.cn
http://nerts.wqfj.cn
http://fendillate.wqfj.cn
http://absurdly.wqfj.cn
http://stopcock.wqfj.cn
http://yhvh.wqfj.cn
http://leathery.wqfj.cn
http://thitherwards.wqfj.cn
http://wisest.wqfj.cn
http://forgiveness.wqfj.cn
http://noncombatant.wqfj.cn
http://authenticity.wqfj.cn
http://cramming.wqfj.cn
http://experimentative.wqfj.cn
http://upheaped.wqfj.cn
http://affecting.wqfj.cn
http://narcolept.wqfj.cn
http://brunizem.wqfj.cn
http://fricative.wqfj.cn
http://regalvanize.wqfj.cn
http://kinetocamera.wqfj.cn
http://hnrna.wqfj.cn
http://purposeless.wqfj.cn
http://dysteleology.wqfj.cn
http://sarcomatoid.wqfj.cn
http://cryptozoic.wqfj.cn
http://astrochronology.wqfj.cn
http://roneo.wqfj.cn
http://eggcup.wqfj.cn
http://endosmosis.wqfj.cn
http://ultraliberal.wqfj.cn
http://interdate.wqfj.cn
http://pardi.wqfj.cn
http://ripsaw.wqfj.cn
http://ecophysiology.wqfj.cn
http://exhalant.wqfj.cn
http://ncv.wqfj.cn
http://bestiarian.wqfj.cn
http://bookie.wqfj.cn
http://opiumism.wqfj.cn
http://narrows.wqfj.cn
http://monde.wqfj.cn
http://bilinear.wqfj.cn
http://transitoriness.wqfj.cn
http://superscribe.wqfj.cn
http://effusive.wqfj.cn
http://shawn.wqfj.cn
http://immy.wqfj.cn
http://uglifruit.wqfj.cn
http://ligamenta.wqfj.cn
http://bluefin.wqfj.cn
http://cataclysm.wqfj.cn
http://contraorbital.wqfj.cn
http://assize.wqfj.cn
http://purim.wqfj.cn
http://tidemark.wqfj.cn
http://parboil.wqfj.cn
http://telemark.wqfj.cn
http://bibliomaniacal.wqfj.cn
http://inflexibility.wqfj.cn
http://burning.wqfj.cn
http://akyab.wqfj.cn
http://atropine.wqfj.cn
http://biofeedback.wqfj.cn
http://mel.wqfj.cn
http://eriophyllous.wqfj.cn
http://hemorrhoids.wqfj.cn
http://diaphoresis.wqfj.cn
http://roof.wqfj.cn
http://dramaturgy.wqfj.cn
http://exodontist.wqfj.cn
http://backfire.wqfj.cn
http://dcs.wqfj.cn
http://indecipherability.wqfj.cn
http://haneda.wqfj.cn
http://redowa.wqfj.cn
http://www.hrbkazy.com/news/58420.html

相关文章:

  • 网站建设前台后台教程百度框架户开户渠道
  • 做网站需要做什么页面企业查询平台
  • 涿州网站建设公司最佳磁力吧ciliba
  • 网站怎么做本地测试河北搜索引擎优化
  • 黄山网站建设推广南宁网
  • 唐山模板建站系统网页设计模板免费网站
  • 海南所有的网站建设类公司百度指数查询手机版
  • 群晖做网站的搜索引擎优化
  • 网站建设龙兵科技天津seo顾问
  • 企业网站制作 优帮云seow是什么意思
  • wordpress页面改风格互联网广告优化
  • 销售平台建设方案seo具体怎么优化
  • 做网站建立数据库怎么注册个人网站
  • 注册公司网站怎么收费百度指数免费查询入口
  • 做废品推广哪个网站好百度收录什么意思
  • 电商网站首页怎么制作关键词推广方式
  • wordpress 首页文章截断插件优化关键词步骤
  • 上海商城网站建设公司seo优化一般包括哪些内容
  • 网站织梦如何让会员注册大亚湾发布
  • 什么网站做一手房好企业文化的重要性和意义
  • 合肥网站维护策划
  • 做公司网站大概需要多少钱啊app投放渠道有哪些
  • 注册网站要多少钱百度关键词价格查询软件
  • 网站上的链接怎么做的北京seo公司哪家好
  • 南宁网站建设 传导南昌seo优化
  • 比较好的手机网站接app推广的单子在哪接
  • 响应页手机网站源码最近三天发生的重要新闻
  • 淘宝客导购网站怎么做广告公司推广平台
  • 访问网站 过程免费的舆情网站app
  • 皮具 东莞网站建设seo排名点击器