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

网站seo优化的重要性手机平台

网站seo优化的重要性,手机平台,营销网站系统,做网站学习题意#xff1a;给你a串和b串#xff0c;你能切k次#xff0c;每次切完将尾部分放在头的前面#xff0c;问有多少种方案切k次从a串变为b串 思路#xff1a;令dp[i][0]为砍了i次变成b串的方案数#xff0c;dp[i][1]为砍了i次变成非b串的方案数#xff0c;然后预处理一下前… 题意给你a串和b串你能切k次每次切完将尾部分放在头的前面问有多少种方案切k次从a串变为b串 思路令dp[i][0]为砍了i次变成b串的方案数dp[i][1]为砍了i次变成非b串的方案数然后预处理一下前缀就可以DP了 #includebits/stdc.h using namespace std; const int mod 1e97; #define LL long long LL dp[300000][2]; int main() {string a,b;int k;cin a b k;int lena a.size();int lenb b.size();if (ab)dp[0][0]1;else dp[0][1]1;int x 0;for (int i 0;ilena;i){int flag 1;for (int j 0;jlena;j){if (a[(ij)%lena] ! b[j]){flag 0;break;}}if (flag)x;}for (int i 0;ik;i){dp[i1][0](x*dp[i][1](x-1)*dp[i][0])%mod;dp[i1][1]((lena-x)*dp[i][0](lena-x-1)*dp[i][1])%mod;}printf(%d\n,dp[k][0]); }Description Lets consider one interesting word game. In this game you should transform one word into another through special operations. Lets say we have word w, lets split this word into two non-empty parts x and y so, that w  xy. A split operation is transforming wordw  xy into word u  yx. For example, a split operation can transform word wordcut into word cutword. You are given two words start and end. Count in how many ways we can transform word start into word end, if we apply exactlyksplit operations consecutively to word start. Two ways are considered different if the sequences of applied operations differ. Two operation sequences are different if exists such number i (1 ≤ i ≤ k), that in the i-th operation of the first sequence the word splits into parts x and y, in the i-th operation of the second sequence the word splits into parts a and b, and additionally x ≠ a holds. Input The first line contains a non-empty word start, the second line contains a non-empty word end. The words consist of lowercase Latin letters. The number of letters in word start equals the number of letters in word end and is at least 2 and doesnt exceed 1000 letters. The third line contains integer k (0 ≤ k ≤ 105) — the required number of operations. Output Print a single number — the answer to the problem. As this number can be rather large, print it modulo 1000000007(109  7). Sample Input Input ab ab 2Output 1Input ababab ababab 1Output 2Input ab ba 2Output 0Hint The sought way in the first sample is: ab → a|b → ba → b|a → ab In the second sample the two sought ways are: ababab → abab|ab → abababababab → ab|abab → ababab 转载于:https://www.cnblogs.com/q934098774/p/5388694.html
http://www.pierceye.com/news/250308/

相关文章:

  • 刷网站关键词排名原理寮步建设网站
  • 银川网站建设一条龙服务服装行业网站模板
  • 重庆建站程序建筑网站起名
  • 便宜网站制作wordpress函数手册
  • 适合在家做的网站工作做音乐网站要求
  • 在哪个网站做视频赚钱的建设彩票网站需要多少投资
  • 大连网站建设意动科技推荐做那个的电影网站
  • 博达 网站群建设wordpress打开乱码
  • 电商网站建设代理商定制网站开发介绍图
  • 网站系统问题解决措施上海网站建设系
  • c 做网站简单吗ui设计需要学什么软件
  • 网站建设app开发公司国内免备案空间
  • nas 支持做网站dedecms 做影网站
  • 网上商城网站模板广州建设技术职业学院
  • 养生网站模板下载山东网站建设哪家专业
  • 最新电子产品网站模板网站建设公司 腾佳
  • 跟公司产品做网站用什么程序做网站最好优化
  • 在线代理网页浏览网站山东省城乡住房建设厅网站
  • 网站建设需准备什么彩页模板图片
  • 怎么用网站源码建站网站换空间步骤
  • 酒店网站开发回扣商丘企业网站建设服务
  • 网站建设策划解决方案河北自助建站系统平台
  • 有没有做高仿手表的网站设计师的职责
  • struts2 做的网站seo公司怎样找客户
  • 帮别人做网站赚钱吗中山快速建站合作
  • 保靖网站建设做网站要运用到代码吗
  • 我用织梦5.7做个网站应该把淘宝客店铺链接放到哪frontpage可以制作网页吗
  • 潍坊优化网站排名在线网页设计培训机构
  • c做的网站ps做 网站标准尺寸
  • 老虎淘客系统可以做网站吗wordpress po mo