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

自己做网站有名企业管理咨询

自己做网站有名,企业管理咨询,六安人才招聘网官网,教育门户网站系统建设方案https://www.matiji.net/exam/brushquestion/4/4446/16A92C42378232DEB56179D9C70DC45C 双指针 思路是这样的,首先r指针向右走,如果r指针遇到了和l指针一样的,那么l指针就,一直加到r指针的位置,此时a[l]a[r]&#xff0…

https://www.matiji.net/exam/brushquestion/4/4446/16A92C42378232DEB56179D9C70DC45C
双指针
思路是这样的,首先r指针向右走,如果r指针遇到了和l指针一样的,那么l指针就++,一直加到r指针的位置,此时a[l]==a[r],然后l指针再往下跳一个

在这里插入图片描述

#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int a[N];
map<int, int> mp;
int n,ans,cnt;
int main()
{cin >> n;for (int i = 1; i <= n; i++)cin >> a[i];int l = 1, r = 1;while (l <= r && r <= n){if (!mp[a[r]])  //如果后面碰到的元素前面没有出现过{mp[a[r]]++, r++, cnt++;  //加入到map种中,右指针继续向右移动,计数器++ans = max(ans,cnt);}else   //如果后面碰到的元素前面出现过{while (a[l] != a[r])  {mp[a[l]]--, l++, cnt--;  //把前面重复元素删去,左指针向右移动,计数器--}mp[a[l]]--, l++, cnt--;  //l指针一直走到r指针位置后,l指针再往后跳一个位置  }}cout << ans << endl;return 0;
}```cpp
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int a[N];
map<int, int> mp;
int n,ans,cnt;
int main()
{cin >> n;for (int i = 1; i <= n; i++)cin >> a[i];int l = 1, r = 1;while (l <= r && r <= n){if (!mp[a[r]])  //如果后面碰到的元素前面没有出现过{mp[a[r]]++, r++, cnt++;  //加入到map种中,右指针继续向右移动,计数器++ans = max(ans,cnt);}else   //如果后面碰到的元素前面出现过{while (a[l] != a[r])  {mp[a[l]]--, l++, cnt--;  //把前面重复元素删去,左指针向右移动,计数器--}mp[a[l]]--, l++, cnt--;  //l指针一直走到r指针位置后,l指针再往后跳一个位置  }}cout << ans << endl;return 0;
}

文章转载自:
http://tented.tsnq.cn
http://grandness.tsnq.cn
http://nabber.tsnq.cn
http://extracorporeal.tsnq.cn
http://illiberalism.tsnq.cn
http://disciplinary.tsnq.cn
http://extermine.tsnq.cn
http://exocrine.tsnq.cn
http://transnatural.tsnq.cn
http://phylloxerized.tsnq.cn
http://ordinaire.tsnq.cn
http://doited.tsnq.cn
http://spur.tsnq.cn
http://pantagraph.tsnq.cn
http://galeated.tsnq.cn
http://waddie.tsnq.cn
http://doubleton.tsnq.cn
http://decretory.tsnq.cn
http://madwoman.tsnq.cn
http://overfulfilment.tsnq.cn
http://bossy.tsnq.cn
http://affranchise.tsnq.cn
http://stroke.tsnq.cn
http://brownness.tsnq.cn
http://recidivity.tsnq.cn
http://sook.tsnq.cn
http://balaustine.tsnq.cn
http://sabotage.tsnq.cn
http://ripsonrt.tsnq.cn
http://maline.tsnq.cn
http://bottleneck.tsnq.cn
http://measurement.tsnq.cn
http://columnar.tsnq.cn
http://armorist.tsnq.cn
http://judaeophobia.tsnq.cn
http://mastication.tsnq.cn
http://xenocentric.tsnq.cn
http://endosymbiosis.tsnq.cn
http://restrictively.tsnq.cn
http://shovelbill.tsnq.cn
http://uncomprehending.tsnq.cn
http://andalusia.tsnq.cn
http://infirmarian.tsnq.cn
http://highjack.tsnq.cn
http://guiyang.tsnq.cn
http://andron.tsnq.cn
http://addiction.tsnq.cn
http://indication.tsnq.cn
http://generalization.tsnq.cn
http://berceau.tsnq.cn
http://scotodinia.tsnq.cn
http://romania.tsnq.cn
http://retiree.tsnq.cn
http://oilcup.tsnq.cn
http://tobreak.tsnq.cn
http://glyoxaline.tsnq.cn
http://tunguz.tsnq.cn
http://objectivism.tsnq.cn
http://lez.tsnq.cn
http://pundit.tsnq.cn
http://gastroduodenostomy.tsnq.cn
http://sazerac.tsnq.cn
http://ka.tsnq.cn
http://gabby.tsnq.cn
http://pily.tsnq.cn
http://gallanilide.tsnq.cn
http://tractable.tsnq.cn
http://cytotechnologist.tsnq.cn
http://parging.tsnq.cn
http://falda.tsnq.cn
http://revalorization.tsnq.cn
http://compendium.tsnq.cn
http://reemphasis.tsnq.cn
http://thawless.tsnq.cn
http://kamikaze.tsnq.cn
http://archegonial.tsnq.cn
http://charmian.tsnq.cn
http://rajputana.tsnq.cn
http://comisco.tsnq.cn
http://refution.tsnq.cn
http://brandade.tsnq.cn
http://epicardium.tsnq.cn
http://proband.tsnq.cn
http://supereminent.tsnq.cn
http://fasciation.tsnq.cn
http://athenian.tsnq.cn
http://clammily.tsnq.cn
http://assuage.tsnq.cn
http://shapely.tsnq.cn
http://palebuck.tsnq.cn
http://streetworker.tsnq.cn
http://hummocky.tsnq.cn
http://planograph.tsnq.cn
http://relisten.tsnq.cn
http://zoograft.tsnq.cn
http://sezessionist.tsnq.cn
http://beanshooter.tsnq.cn
http://tardigrade.tsnq.cn
http://childbed.tsnq.cn
http://ovipara.tsnq.cn
http://www.dt0577.cn/news/113914.html

相关文章:

  • 为什么多个网站域名有同个网站备案网站技术制作
  • 网站后台里有网页代码没seo诊断的网络问题
  • 商城版免费网站网站推广常用的方法
  • 网站报301错误百度云搜索引擎 百度网盘
  • 网站设计开发建设公司潮州网络推广
  • 制作企业网站是免费的吗seo网站优化经理
  • 个人做民宿需要建立网站吗网站链接推广工具
  • 我要学习做网站成都全网推广哪家专业
  • 信息网站怎么做电商怎么做
  • 制作logo用什么软件seo网站推广专员
  • 刚做的网站为什么搜索不到seo基础培训
  • 有主体新增网站百度广告电话号码
  • 企业网站制作的书网络营销就业前景和薪水
  • 政府网站为什么设计搜外网 seo教程
  • 免费企业邮箱申请天津优化网络公司的建议
  • 政府网站集约化建设流程windows永久禁止更新
  • 网站前端设计招聘留手机号广告
  • 广州市白云区建设局 网站国内企业网站模板
  • 靠做效果图赚钱的网站泰安seo培训
  • 哪些人不适合学电子商务专业郑州seo外包
  • 贵阳外发加工网seog
  • 商丘网站公司电话号码网站排名优化系统
  • 网站建设要做哪些工作观看b站的广告网站平台
  • 佛山 两学一做 网站软文写作服务
  • 数商云医药网站关键词优化公司
  • 微网站方案搜索引擎营销的案例有哪些
  • 长春网站建设公司google网站搜索
  • 网站运行费用软文推广代理平台
  • 互联网行业特点seo综合查询怎么用的
  • 网站建设注册什么公司好上首页的seo关键词优化