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

做301网站打不开网上智慧团建网站

做301网站打不开,网上智慧团建网站,公司网站推广怎么做,哪些大型网站用python做的传送门 文章目录题意#xff1a;思路#xff1a;题意#xff1a; 思路#xff1a; 由kmpkmpkmp中失配数组nenene的含义我们知道#xff0c;ne[i],ne[ne[i]],...ne[i],ne[ne[i]],...ne[i],ne[ne[i]],...都是iii的相等的前后缀#xff0c;但是可能有重叠的部分#xff0c…传送门 文章目录题意思路题意 思路 由kmpkmpkmp中失配数组nenene的含义我们知道ne[i],ne[ne[i]],...ne[i],ne[ne[i]],...ne[i],ne[ne[i]],...都是iii的相等的前后缀但是可能有重叠的部分那么就有一个显然的做法对于每个iii不断向前跳记录ne[x]i/2ne[x]i/2ne[x]i/2的个数复杂度O(n2)O(n^2)O(n2)。 考虑优化我们记录一个数组cnt[i]cnt[i]cnt[i]表示可重叠的后缀个数这个显然可以通过求nenene的时候递推出来那么我们跳到ne[x]i/2ne[x]i/2ne[x]i/2的时候直接加上cnt[x]cnt[x]cnt[x]即可但是这样还是会被aaaaaaaaaaaaaaa这种的串串卡掉继续优化。 考虑利用之前的信息由于到了iii我们就暴跳到ne[x]i/2ne[x]i/2ne[x]i/2那么对于i1i1i1一定有ne[x](i1)/2ne[x](i1)/2ne[x](i1)/2满足要求复杂度O(n)O(n)O(n)。 当然还有一个无脑的做法就是倍增优化暴跳的方式复杂度O(tnlogn)O(tnlogn)O(tnlogn)能过也是奇迹不过还是需要一些卡常的比如将数组f[N][20]f[N][20]f[N][20]写成f[20][N]f[20][N]f[20][N]这样快了1s1s1s。 O(n)O(n)O(n) // Problem: P2375 [NOI2014] 动物园 // Contest: Luogu // URL: https://www.luogu.com.cn/problem/P2375 // Memory Limit: 512 MB // Time Limit: 1000 ms // // Powered by CP Editor (https://cpeditor.org)//#pragma GCC optimize(Ofast,no-stack-protector,unroll-loops,fast-math) //#pragma GCC target(sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tunenative) //#pragma GCC optimize(2) #includecstdio #includeiostream #includestring #includecstring #includemap #includecmath #includecctype #includevector #includeset #includequeue #includealgorithm #includesstream #includectime #includecstdlib #includerandom #includecassert #define X first #define Y second #define L (u1) #define R (u1|1) #define pb push_back #define mk make_pair #define Mid ((tr[u].ltr[u].r)1) #define Len(u) (tr[u].r-tr[u].l1) #define random(a,b) ((a)rand()%((b)-(a)1)) #define db puts(---) using namespace std;//void rd_cre() { freopen(d://dp//data.txt,w,stdout); srand(time(NULL)); } //void rd_ac() { freopen(d://dp//data.txt,r,stdin); freopen(d://dp//AC.txt,w,stdout); } //void rd_wa() { freopen(d://dp//data.txt,r,stdin); freopen(d://dp//WA.txt,w,stdout); }typedef long long LL; typedef unsigned long long ULL; typedef pairint,int PII;const int N1000010,mod1e97,INF0x3f3f3f3f; const double eps1e-6;int n; char s[N]; int ne[N],pre[N];inline int read(){char chgetchar(); int x0,w1;while(ch0||ch9) {if(ch-) w-1; chgetchar();}while(ch0ch9) {x(x3)(x1)(ch^48); chgetchar();}return x*w; }int main() { // ios::sync_with_stdio(false); // cin.tie(0);int _; _read();while(_--) {scanf(%s,s1);nstrlen(s1);pre[1]1;for(int i2;in;i) {int jne[i-1];while(js[i]!s[j1]) jne[j];if(s[i]s[j1]) j;ne[i]j; pre[i]pre[j]1;}LL ans1;for(int i2,j0;in;i) {while(js[i]!s[j1]) jne[j];if(s[i]s[j1]) j;while(ji/2) jne[j];ans*pre[j]1; ans%mod;}printf(%lld\n,ans);}return 0; } /* abababab */ O(tnlogn)O(tnlogn)O(tnlogn) // Problem: P2375 [NOI2014] 动物园 // Contest: Luogu // URL: https://www.luogu.com.cn/problem/P2375 // Memory Limit: 512 MB // Time Limit: 1000 ms // // Powered by CP Editor (https://cpeditor.org)//#pragma GCC optimize(Ofast,no-stack-protector,unroll-loops,fast-math) //#pragma GCC target(sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tunenative) //#pragma GCC optimize(2) #includecstdio #includeiostream #includestring #includecstring #includemap #includecmath #includecctype #includevector #includeset #includequeue #includealgorithm #includesstream #includectime #includecstdlib #includerandom #includecassert #define X first #define Y second #define L (u1) #define R (u1|1) #define pb push_back #define mk make_pair #define Mid ((tr[u].ltr[u].r)1) #define Len(u) (tr[u].r-tr[u].l1) #define random(a,b) ((a)rand()%((b)-(a)1)) #define db puts(---) using namespace std;//void rd_cre() { freopen(d://dp//data.txt,w,stdout); srand(time(NULL)); } //void rd_ac() { freopen(d://dp//data.txt,r,stdin); freopen(d://dp//AC.txt,w,stdout); } //void rd_wa() { freopen(d://dp//data.txt,r,stdin); freopen(d://dp//WA.txt,w,stdout); }typedef long long LL; typedef unsigned long long ULL; typedef pairint,int PII;const int N1000010,mod1e97,INF0x3f3f3f3f; const double eps1e-6;int n; char s[N]; int ne[N]; int f[21][N];int main() { // ios::sync_with_stdio(false); // cin.tie(0);int _; scanf(%d,_);while(_--) {scanf(%s,s1);nstrlen(s1);for(int i2,j0;in;i) {while(js[i]!s[j1]) jne[j];if(s[i]s[j1]) j;ne[i]j; f[0][i]ne[i];}for(int k1;k19;k) for(int i1;in;i) f[k][i]f[k-1][f[k-1][i]];int ans1;for(int i2;in;i) {int now0,xi;for(int j19;j0;j--) if(f[j][x]*2i) xf[j][x];for(int j19;j0;j--) if(f[j][x]) now1j,xf[j][x];ans1ll*ans*(now1)%mod;}printf(%d\n,ans);}return 0; } /**/
http://www.pierceye.com/news/100254/

相关文章:

  • 做网站前期创建文件夹博罗高端网站建设价格
  • 襄阳网站建设价格淄博网站推广价格
  • 网站推广的软件六安网站制作哪里有
  • 大型门户网站模板wordpress有哪些小工具
  • 有flash的网站新闻资讯app制作公司
  • 网站和平台有什么区别黄页88怎么发信息质量高
  • 阿里建站价格小户型室内装修设计公司网站
  • 建设银行网站安全性分析网络推广服务平台
  • 大型购物网站建设福建微网站建设公司
  • 做网站软件j程序员找工作网站
  • 济南网站建设系统画册设计公司宣传册
  • 上海网站设计方案家纺网站建设
  • 衡水精品网站建设游戏广告推广平台
  • 响应式企业网站建设营销战略
  • wordpress离线浏览搜索引擎优化包括
  • 门户网站建设需要多少呼伦贝尔市住房和城乡建设局网站
  • 静海集团网站建设住房城乡建设网站
  • 个人备案挂企业网站网站开发公司照片
  • 网站建设课程体会国内最新新闻简短
  • 网站开发大概价格最常用的网页制作软件
  • 商务网站模块设计时前台基础设施建设免费网站建设空间
  • 青海省公路工程建设总公司网站饮料公司网站模板
  • 建设部网站刘赵云网页版邮箱
  • 免费扑克网站企业网站怎么搜索优化
  • 做网站导航的厦门网站建设制作多少钱
  • 怎样免费注册网站域名鹤城建设集团网站
  • 3合1网站建设价格网站建设论坛快速建站
  • 怎样做钓鱼网站上海网站关键词排名优化报价
  • 昆明专业网站设计公司电商类网站设计模板
  • 网站流量用完了重庆网站推广