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

网络优化网络维护网络建站怎样建设网站公司

网络优化网络维护网络建站,怎样建设网站公司,网站建设到上线的步骤过程,关键词优化怎么做文章目录 CF778A String Game 题解题面翻译Input DataOutput DataInput Sample 1Output Sample 1题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1 样例 #2样例输入 #2样例输出 #2 提示算法#xff1a;二分代码#xff1a; CF778A String Game 题解 link 题面翻译 … 文章目录 CF778A String Game 题解题面翻译Input DataOutput DataInput Sample 1Output Sample 1题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1 样例 #2样例输入 #2样例输出 #2 提示算法二分代码 CF778A String Game 题解 link 题面翻译 给定两个由小写字母构成的字符串p和t同时给定一个由数字 1 , 2 , 3... ∣ P ∣ 1,2,3...∣P∣ 1,2,3...∣P∣ 组成的排列。其中 ∣ p ∣ ∣p∣ ∣p∣ 表示字符串p的长度按该排列顺序依次删除字符串 p p p 相应位置上的字母删除过程中约定各个字符的位置不变。请计算最多可以删除几次字符串 p p p 中仍然包含字符串 t t t。即字符串 t t t 仍然是字符串 p p p 的子序列 数据保证有解。 Input Data 第一行一个字符串 p p p 1 ≤ ∣ p ∣ ∣ t ∣ ≤ 200 , 0000 1≤∣p∣∣t∣≤200,0000 1≤∣p∣∣t∣≤200,0000 第二行一个字符串 t t t 第三行数字 1 1 1 到 ∣ p ∣ ∣p∣ ∣p∣ 组成的一个排列。 Output Data 一行一个整数表示最多删除的次数。 Input Sample 1 ababcbaabb5 3 4 1 7 6 2Output Sample 1 3题目描述 Little Nastya has a hobby, she likes to remove some letters from word, to obtain another word. But it turns out to be pretty hard for her, because she is too young. Therefore, her brother Sergey always helps her. Sergey gives Nastya the word t t t and wants to get the word p p p out of it. Nastya removes letters in a certain order (one after another, in this order strictly), which is specified by permutation of letters’ indices of the word t t t : a 1 . . . a ∣ t ∣ a_{1}...\ a_{|t|} a1​... a∣t∣​ . We denote the length of word x x x as ∣ x ∣ |x| ∣x∣ . Note that after removing one letter, the indices of other letters don’t change. For example, if t t t “nastya” and a [ 4 , 1 , 5 , 3 , 2 , 6 ] a[4,1,5,3,2,6] a[4,1,5,3,2,6] then removals make the following sequence of words “nastya” “nastya” “nastya” “nastya” “nastya” “nastya” “nastya”. Sergey knows this permutation. His goal is to stop his sister at some point and continue removing by himself to get the word p p p . Since Nastya likes this activity, Sergey wants to stop her as late as possible. Your task is to determine, how many letters Nastya can remove before she will be stopped by Sergey. It is guaranteed that the word p p p can be obtained by removing the letters from word t t t . 输入格式 The first and second lines of the input contain the words t t t and p p p , respectively. Words are composed of lowercase letters of the Latin alphabet ( $ |p||t|200000$ ). It is guaranteed that the word $ p $ can be obtained by removing the letters from word t t t . Next line contains a permutation a 1 , a 2 , . . . , a ∣ t ∣ a_{1},a_{2},...,a_{|t|} a1​,a2​,...,a∣t∣​ of letter indices that specifies the order in which Nastya removes letters of t t t ( 1 a i ∣ t ∣ 1a_{i}|t| 1ai​∣t∣ , all a i a_{i} ai​ are distinct). 输出格式 Print a single integer number, the maximum number of letters that Nastya can remove. 样例 #1 样例输入 #1 ababcba abb 5 3 4 1 7 6 2样例输出 #1 3样例 #2 样例输入 #2 bbbabb bb 1 6 3 4 2 5样例输出 #2 4提示 In the first sample test sequence of removing made by Nastya looks like this: “ababcba” “ababcba” “ababcba” “ababcba” Nastya can not continue, because it is impossible to get word “abb” from word “ababcba”. So, Nastya will remove only three letters. 算法二分 二分枚举什么我们可以枚举删除的元素个数。 可行性假设删去 x x x 个元素可行那么删去 x − 1 x - 1 x−1 个元素也肯定可行。因此二分的序列有单调性该二分成立。 check 函数怎么写判断删掉 x x x 个元素后是否包含序列 t t t 即可。 代码 #includebits/stdc.h using namespace std; #define ll long long const ll N2e610; ll n,nt,a[N],l,r,mid,ans; string p,t; bool check(ll x){string kp;ll ct0;for(int i1;ix;i) k[a[i]-1] ;for(int i0;in;i){if(k[i]t[ct]) ct;if(ctnt) return 1; } return 0; } int main(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cinpt;np.size(),ntt.size();for(int i1;in;i) cina[i];rn;while(lr){midlr1;if(check(mid)) ansmid,lmid1;else rmid-1;}coutans;return 0; } 感谢大家的支持~
http://www.dnsts.com.cn/news/85005.html

相关文章:

  • 做网页跳转网站赣州做网站的公司有哪家好
  • 建设项目环境影响评价公示网站苏州做学校网站的
  • 网站开发有必要用php框架深圳高端网站设计
  • 常州专业网站建设公司哪家好互助网站建设
  • 网站做链轮会被惩罚吗网站宣传虚假处罚标准
  • 做网站的入什么科目百度电话人工服务
  • 徐州有名的设计公司佛山专业的免费网站优化
  • 成品网站 免费怎么用云主机做网站
  • 海南网站优化公司好玩网页游戏
  • 湘潭做网站 要到磐石网络全屋定制十大名牌谁最好
  • 东莞网站建设 手袋厂中国建设银行南京分行网站首页
  • 公司网站制作需要多少钱一个网站建设都需要什么
  • 高端网站制作服装设计师怎么学
  • 网站页面格式推广赚钱群
  • 东莞公司网站搭建多少钱网站开发设计报告书怎么写
  • 网站设计的英文网站建设 织梦者
  • xin网站ftp上传网站机房建设
  • 自己网站如何做关键词北京中燕建设公司网站
  • 建设厅安检局网站给 wordpress category (分类)添加字段
  • 顺义做网站的厂家wordpress迅雷插件下载
  • 安徽工业大学两学一做网站工作细胞第一季免费
  • 模板手机网站建设价格明细表做二手网站有哪些问题
  • 摄影网站模板下载企业信用不良记录查询
  • 做PS的赚钱的网站在线crm客户关系管理
  • 商品网站建设实验格式中国建设网建设通
  • 做义齿雕刻设备的网站2023还能上的网站
  • 阜南做网站公司网站制作验收单
  • 辽宁省建设机械协会官方网站成品网站的安装教程
  • 网站开发公司上在中国做国外网站
  • 嘉兴网站设计999 999最新网站开发软件