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

如何绑定网站域名专业的镇江网站建设

如何绑定网站域名,专业的镇江网站建设,福州网站建设专业公司,凡科快图软件下载键盘特殊Problem statement: 问题陈述#xff1a; Imagine you have a special keyboard with four types of keys: 想象一下#xff0c;您有一个特殊的键盘#xff0c;其中包含四种类型的键#xff1a; Key 1: Prints I on screen 按键1#xff1a;在屏幕上打印“ I”…键盘特殊Problem statement: 问题陈述 Imagine you have a special keyboard with four types of keys: 想象一下您有一个特殊的键盘其中包含四种类型的键 Key 1: Prints I on screen 按键1在屏幕上打印“ I” Key 2: Select whatever printed in screen 键2选择屏幕上打印的任何内容 Key 3: Copy selection to buffer 关键3将选择复制到缓冲区 Key 4: Append buffer on-screen after what has already been printed. If you can only press the keyboard for N times (with the above four keys), write a program to produce maximum numbers of Is possible to be printed on the screen. 关键4在已打印的内容之后在屏幕上追加缓冲区。 如果您只能按键盘N次(使用上述四个键)请编写一个程序以产生最大数量的I(可以在屏幕上打印)。 Input: 输入 Input is N, number of times keys can be pressed in total. 输入为N 总共可以按键的次数。 Output: 输出 Print maximum number of Is possible to print 打印我可以打印的最大数量 Constraints: 限制条件 1 ≤ N ≤ 75 Example: 例 Input: 2 Output: 2 Explanation: We can at most get 2 Is on screen by pressing following key sequence Key1, key1. Pressing other keys have no effect. Like key 1, key2 will produce only one I on screen. Input: 7 Output: 9 Explanation: We can at most get 9 Is on screen by pressing following key sequence. Key1, Key1, Key1, Key2, Key3, key4, Key4 I //after pressing key1 I I //again pressing key 1 I I I //again pressing key1 I I I //pressing key2 selects three Is I I I // pressing key3 copies these three Is to buffer I I I I I I // pressing key4 appends these three Is I I I I I I I I I // pressing key4 again appends these three Is Solution Approach: 解决方法 Basically, 基本上 Two things need to be understood to solve this problem 解决此问题需要了解两点 Key4 appends whatever is printed already on screen before 3 key pressing 按下3键之前 Key4会附加屏幕上已经打印的内容 That means at moment 4, 这意味着在第四时刻 You can append whatever was printed while moment 1 as to print in moment 4, you need to press key2 at moment 2 and key3 at moment 3. 您可以在第1时刻添加要在第4时刻打印的内容然后在第2时刻按key2 在第3时刻按key3 。 So, the recursive function can be written as 因此递归函数可以写成 Let, 让 F(n)  max number of I’s printed on screen F(n) 我在屏幕上打印的最大数量 So, for n3 因此对于n 3 F(n) max(f(j)*(n-j-1)) for 1jn-3 Where, F(j) already printed characters up to moment j and (n-j-1) is number of appending possible So, now we need to convert the recursion into DP. 因此现在我们需要将递归转换为DP。 1) Initialize dp[n1] like following base value; 2) for i0 to n dp[i]i; 3) Fill the DP table for i4 to n for ji-3 to 1,j-- dp[i]max(dp[i],dp[j]*(i-j-1)); end for End for 4) Return dp[n] C Implementation: C 实现 #include bits/stdc.h using namespace std; int specialKeyboard(int n) { int dp[n 1]; for (int i 0; i n; i) dp[i] i; for (int i 6; i n; i) { for (int j i - 3; j 1; j--) { dp[i] std::max(dp[i], dp[j] * (i - j - 1)); } } return dp[n]; } int main() { int t, n, item; cout Input n, number of times keys to be pressed: ; scanf(%d, n); cout max no of is got printed: specialKeyboard(n) endl; return 0; } Output: 输出 Input n, number of times keys to be pressed: 7 max no of is got printed: 9 翻译自: https://www.includehelp.com/icp/special-keyboard.aspx键盘特殊
http://www.huolong8.cn/news/351280/

相关文章:

  • 响应式网站弊端app store下载正版
  • 网站怎么做能赚钱吗个人网站首页布局图
  • 60天做网站qq创号申请注册网站
  • 网站 语言切换怎么做如何用手机制作游戏
  • 哈尔滨制作企业网站高端网页制作公司哪家好
  • 网站优化专家室内装修设计上海
  • php租车网站物业网站宣传册怎么做
  • 怎样创建一个国际网站江西网站建设与推广
  • 网站建设 需求模板寻找网站开发
  • 国内比较高端的设计网站临沂网站维护公司
  • 哔哩哔哩网站建设最新国际新闻 大事件
  • 如何让网站火起来唐山建设集团招聘信息网站
  • 高校网站平台建设nginx优化wordpress网站速度
  • 只做PC版网站免费建设自己的文学网站
  • 企业网站建设 新天地网络长沙网站制作有哪些公司
  • 广东省建设工程质量安全监督检测总站网站河南工程学院网站建设
  • 怎么样制作一个公司网站物联网工程就业方向及前景
  • 网站建设验收条款哪些网站可以做ppt赚钱
  • 网站开发公司模版怎么键卖东西的网站
  • 学校网站开发程序个人求职网站怎么做
  • 网站300m是什么意思做网站和做app哪个贵
  • 封装系统如何做自己的网站云浮东莞网站建设
  • 定制高端网站怎么在本地安装wordpress
  • 微信小程序如何创建湛江企业网站seo
  • 网站建设有哪些规章制度wordpress 移动主题 crystal
  • 网站建设的内容有哪些网站项目名称
  • wordpress+短视频主题福州seo推广
  • 撰写网站策划书温州网站建设和推广
  • 网站业务建设是什么巩义企业网站建设
  • 管局审核一定要能打开网站国际业务网站有哪些