国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

wp怎么做雙語網(wǎng)站百度快速收錄入口

wp怎么做雙語網(wǎng)站,百度快速收錄入口,網(wǎng)站建設(shè)官方商城,淘寶網(wǎng)做寶貝詳情用哪個網(wǎng)站卡碼網(wǎng)圖論更新了可以去看看,模擬筆試第四題就是深搜/廣搜還不太會 LeetCode 392 判斷子序列 其實就是最長公共子序列翻版 代碼如下: class Solution {public boolean isSubsequence(String s, String t) {int[][] dp new int[s.length() 1][t.lengt…

卡碼網(wǎng)圖論更新了可以去看看,模擬筆試第四題就是深搜/廣搜還不太會

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();}
}

模擬美團(tuán)筆試第一題 小美的排列詢問


簡單模擬

代碼如下:

#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://m.aloenet.com.cn/news/31070.html

相關(guān)文章:

  • 網(wǎng)站空間支持什么程序邯鄲百度推廣公司
  • mvc5 web網(wǎng)站開發(fā)實戰(zhàn)廣州百度seo優(yōu)化排名
  • 貴金屬網(wǎng)站模板網(wǎng)站收錄提交入口網(wǎng)址
  • dw如何用表格做網(wǎng)站免費(fèi)網(wǎng)頁制作平臺
  • 代理服務(wù)器地址怎么找搜狗排名優(yōu)化工具
  • b2c商城網(wǎng)站建設(shè)目的網(wǎng)頁關(guān)鍵詞優(yōu)化軟件
  • 網(wǎng)站開發(fā) 群百度公司的企業(yè)文化
  • 做網(wǎng)站借用網(wǎng)絡(luò)圖片不違法吧北京seo的排名優(yōu)化
  • 網(wǎng)站開發(fā)工作室中國站長之家官網(wǎng)
  • 慈溪哪點(diǎn)有學(xué)做網(wǎng)站的外鏈官網(wǎng)
  • 深圳市住房和建設(shè)局紅色警示青島seo精靈
  • 廣西慶海建設(shè)發(fā)展有限公司網(wǎng)站網(wǎng)絡(luò)營銷計劃包括哪七個步驟
  • 網(wǎng)頁制作語言seo優(yōu)化包括哪些內(nèi)容
  • 小程序代理多少錢新余seo
  • 外貿(mào)怎么上國外的網(wǎng)站百度搜索引擎排行榜
  • 分類信息網(wǎng)站有哪些關(guān)鍵詞優(yōu)化案例
  • wordpress主題一鍵生成云南網(wǎng)站建設(shè)快速優(yōu)化
  • 建設(shè)商業(yè)門戶網(wǎng)站的重要適合獎勵自己的網(wǎng)站免費(fèi)
  • 劍網(wǎng)三魁首怎么做網(wǎng)站在線建站平臺
  • wordpress手機(jī)中文版seo優(yōu)化是什么職業(yè)
  • 濟(jì)南網(wǎng)站制作價格吸引顧客的營銷策略
  • 源碼開發(fā)網(wǎng)站建設(shè)市場營銷四大分析方法
  • 網(wǎng)站水印怎么做的推廣網(wǎng)頁
  • 帶dede后臺的整套網(wǎng)站源碼怎么本地測試安裝上海短視頻培訓(xùn)機(jī)構(gòu)
  • 小說網(wǎng)站建設(shè)箋池齋上海百度推廣官方電話
  • 啤酒免費(fèi)代理0元鋪貨優(yōu)化軟件有哪些
  • 網(wǎng)站策劃包括什么國內(nèi)免費(fèi)b2b網(wǎng)站大全
  • 網(wǎng)站建設(shè)死人接單關(guān)鍵詞查找工具
  • 網(wǎng)站做xss過濾seo快速排名軟件平臺
  • 做網(wǎng)站很累官方網(wǎng)站怎么注冊