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

server 2008 iis部署网站seo自学

server 2008 iis部署网站,seo自学,集团网,计算机域名的格式卡码网图论更新了可以去看看,模拟笔试第四题就是深搜/广搜还不太会 LeetCode 392 判断子序列 其实就是最长公共子序列翻版 代码如下: class Solution {public boolean isSubsequence(String s, String t) {int[][] dp new int[s.length() 1][t.lengt…

卡码网图论更新了可以去看看,模拟笔试第四题就是深搜/广搜还不太会

LeetCode 392 判断子序列


其实就是最长公共子序列翻版

代码如下:

class Solution {public boolean isSubsequence(String s, String t) {int[][] dp = new int[s.length() + 1][t.length() + 1];int result = 0;for (int i = 1; i <= s.length(); i++) {for (int j = 1; j <= t.length(); j++) {if (s.charAt(i-1) == t.charAt(j-1))dp[i][j] = Math.max(dp[i][j], dp[i-1][j-1]+1);else dp[i][j] = Math.max(dp[i][j-1], dp[i-1][j]);if (result < dp[i][j]) result = dp[i][j];}}return result == s.length();}
}

模拟美团笔试第一题 小美的排列询问


简单模拟

代码如下:

#include <iostream>using namespace std;int main() {int n;cin >> n;int a[n];for (int i = 0; i < n; i++) cin >> a[i];int x, y;cin >> x >> y;for (int i = 0; i < n; i++) {if (a[i] == x || a[i] == y) {if (i + 1 < n && (a[i+1] == x || a[i+1] == y) && a[i+1] != a[i]) {cout << "Yes" << endl;return 0;} else break;}}cout << "No" << endl;
}

第二题 小美走公路


简单模拟

代码如下:

#include <iostream>
#include <bits/stdc++.h>
using namespace std;int main() {int n;cin >> n;long long a[n];long long sum = 0;for (int i = 0; i < n; i++) {cin >> a[i];sum += a[i];}    int x, y;cin >> x >> y;if (x > y) {long long t = y;y = x;x = t;}if (x == y) {cout << 0 << endl;return 0;}long long cost = 0;for (int i = x; i < y; i++) {cost += a[i];}cost = min(cost, sum - cost);cout << cost << endl;
}

第三题 小美的蛋糕切割


二维前缀和

代码如下:

#include <iostream>
#include <bits/stdc++.h>
using namespace std;int main() {int n;cin >> n;long long a[n];long long sum = 0;for (int i = 0; i < n; i++) {cin >> a[i];sum += a[i];}    int x, y;cin >> x >> y;if (x > y) {long long t = y;y = x;x = t;}if (x == y) {cout << 0 << endl;return 0;}long long cost = 0;for (int i = x; i < y; i++) {cost += a[i];}cost = min(cost, sum - cost);cout << cost << endl;
}

http://www.yayakq.cn/news/372656/

相关文章:

  • 郴州网站建设公司有哪些电商网站推广常见问题
  • 门户系统设计中国网站优化哪家好
  • 创建微网站wordpress后台打开太慢
  • 新兴县建设局网站wordpress 注册会员
  • 龙岗网站建设设计服务微信crm管理系统
  • 专业上海网站建设公司wordpress小蜜蜂
  • 商河便宜做网站的公司湖北企业网站优化排名
  • 网站建设初学者教程凡科网站可以做淘宝客吗
  • 学做彩票网站做农产品交易网站
  • 做面料哪个网站好seo推广的步骤
  • 在网站做直播企业所得税优惠政策2020
  • 网站标题作弊莆田网站建设解决方案
  • 个人备案网站做淘宝客可以网络营销和传统营销有什么区别
  • 中国书画画廊网站模板asp网站跳转浏览器
  • 淄博做网站电话汕头名域设计
  • 阿里巴巴网站域名注册seo投放营销
  • 域名分析网站市场营销说白了就是干什么的
  • 做网站题材企业网站建设 电脑配置
  • 通州网站网站建设广州最新发布最新
  • wordpress设置网站地址网站制作用什么语言
  • 一线城市做网站工资有多少钱建设银行官方网站公司
  • 石家庄万达网站制作购物网站建设建站
  • 秦皇岛建设信息网站做任务得佣金的网站
  • 网站建设和整改方案c 网站开发案例详解光盘
  • 天河网站建设优化做网站公司法人还要拍照吗
  • 高唐住房建设局网站公司网站建设行业怎么样
  • 萍乡网站建设哪家好中国制造网怎么注册
  • 如果在阿里云上做自己的网站猎头公司前十名有哪些
  • 360网站开发wordpress 输出数组
  • 网站底部悬浮wordpress基础服务器