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

全国做网站的公司有哪些做a 需要制作网站

全国做网站的公司有哪些,做a 需要制作网站,深圳网站建设要多少钱,新网站 seo出自一次很失败的开学测试 LIS自然会做 可以参见#xff1a;https://blog.csdn.net/Radium_1209/article/details/79704234 由于对于LIS的nlogn算法不熟悉#xff0c;导致错误理解#xff0c;记录的路径出现了问题#xff0c;其中还用了n^2的算法记录路径#xff08;好理解… 出自一次很失败的开学测试 LIS自然会做 可以参见https://blog.csdn.net/Radium_1209/article/details/79704234 由于对于LIS的nlogn算法不熟悉导致错误理解记录的路径出现了问题其中还用了n^2的算法记录路径好理解但是不出所料T了。 正确的方法应该是由于nlogn算法中dp[i]存的是长度为i的最后一位数字并不是路径我们可以用一个path数组来标记每一个数字位于的位置然后通过dfs倒着来找最后结果长度的最后一个或者不用dfs直接找也行。   例题(UVA481) Write a program that will select the longest strictly increasing subsequence from a sequence of integers. Input The input file will contain a sequence of integers (positive, negative, and/or zero). Each line of the input file will contain one integer. Output The output for this program will be a line indicating the length of the longest subsequence, a newline, a dash character (-), a newline, and then the subsequence itself printed with one integer per line. If the input contains more than one longest subsequence, the output file should print the one that occurs last in the input file. Notice that the second 8 was not included -- the subsequence must be strictly increasing. Sample Input -7 10 9 2 3 8 8 1 Sample Output 4 - -7 2 3 8题意求LIS并输出路径最后一个 dfs版 #include cstdio #include iostream using namespace std;int n1,a[1000005]; int dp[1000005]; int path[1000005];void dfs(int i,int x) {if (i1 || x0)return;while(path[i]!x)i--;dfs(i,x-1);printf(%d\n,a[i]); }int main() {while(~scanf(%d,a[n])){n;}n--;int len1;dp[1]a[1]; path[1]1;for (int i2;in;i){if (a[i]dp[len]){dp[len]a[i];path[i]len;}else{int poslower_bound(dp1,dplen1,a[i])-dp;dp[pos]a[i];path[i]pos;}}printf(%d\n-\n,len);dfs(n,len);return 0; }非dfs版 #include cstdio #include iostream using namespace std;int n1,a[1000005]; int dp[1000005]; int path[1000005]; int ans[1000005];int main() {while(~scanf(%d,a[n])){n;}n--;int len1;dp[1]a[1]; path[1]1;for (int i2;in;i){if (a[i]dp[len]){dp[len]a[i];path[i]len;}else{int poslower_bound(dp1,dplen1,a[i])-dp;dp[pos]a[i];path[i]pos;}}printf(%d\n-\n,len);int tempn;int llen;while(l1){int i;for(itemp;i1;i--){if (path[i]l){ans[l]a[i];l--; tempi;break;}}if (i0)break;}for (int i1;ilen;i)printf(%d\n,ans[i]);return 0; }   n^2版本T了正确性未知 #include cstdio #include iostream using namespace std;int n1,a[1000005]; int dp[1000005]; int path[1000005]; int ans[1000005];int main() {while(~scanf(%d,a[n])){n;}n--;int len0;for (int i1;in;i){dp[i]1;for (int j1;ji;j)if (a[j]a[i]){if (dp[i]dp[j]1){dp[i]dp[j]1;path[dp[i]]j;}}if (dp[i]len){lendp[i];ans[len]a[i];for (int ilen;i2;i--)ans[i-1]a[path[i]];}}printf(%d\n-\n,len);for (int i1;ilen;i)printf(%d\n,ans[i]);return 0; }   转载于:https://www.cnblogs.com/Radium1209/p/10415345.html
http://www.zqtcl.cn/news/240438/

相关文章:

  • 学校网站模板 中文版沈阳seo博客
  • seo策划方案整站优化服务
  • 灵芝产品网站建设方案wordpress登录开发
  • 企业网站软件开发部署php网站
  • 云服务器怎么搭建网站网站制作软件是什么
  • 网站建设的结尾官网网站设计
  • 网站开发网页超链接路径如何用dw修改wordpress的首页
  • 龙岗开发公司网站建设简述网站的制作流程
  • 杭州手机建站模板尤溪建设局网站
  • 北京手机网站设计报价网站建设计划表
  • php做的网站如何该样式如何卸载安装wordpress
  • 建设网站公司哪家性价比高最新推广注册app拿佣金
  • 丽水网站建设公司排名wordpress 去掉图片链接
  • 以下属于网站页面设计的原则有2345网址下载
  • 为网站的特色功能设计各种模板温州网页模板建站
  • 广州微网站建设企业网站建设网站优化推广
  • 大连模板网建站项目网络的关键路径
  • 迅雷黄冈网站推广软件徐州模板自助建站
  • 怎么做不占CPU的网站修改wordpress的登陆地址
  • 网站制作毕业设计论文软件ui设计培训机构
  • 物业网站模板哪里建设网站
  • 达州城乡建设网站手机网站 方案
  • 平台兼职网站开发许昌做网站优化
  • 婴幼儿用品网站开发意义基因网站开发
  • 自己网站页面设计软件传奇世界游戏官网
  • 淘宝网网站开发部技术部三亚私人高清影院品牌加盟
  • 网站是用什么软件做的山西网络科技有限公司
  • 汕头网站建设开发做购物网站 营业范围是什么
  • 网站建设 企业短视频运营计划书
  • 网站仿静态网站城市分站织梦系统