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

肇庆网站建设公司seo综合排名优化

肇庆网站建设公司,seo综合排名优化,自己做网站建议,难道做网站的工资都不高吗刷题刷题刷题刷题 ​​​​​​​​​​​​​​Forgery - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 思路: 需要两个数组,一个数组全部初始化为".",另一个数组输入数据,每碰到一个“.”就进行染色操作,将其周围的…

刷题刷题刷题刷题

​​​​​​​​​​​​​​Forgery - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)

思路:

需要两个数组,一个数组全部初始化为".",另一个数组输入数据,每碰到一个“.”就进行染色操作,将其周围的8个全部变成"#",全部染完色之后将两个数组进行比对,若完全一样则YES,否则NO

AC代码:

#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<vector>
#include<math.h>
#include <stdio.h>
using namespace std;
typedef long long ll;
inline int read()
{int k = 0, f = 1; char ch = getchar();while (ch < '0' || ch>'9'){if (ch == '-')f = -1;ch = getchar();}while (ch >= '0' && ch <= '9'){k = k * 10 + ch - '0';ch = getchar();}return k * f;
}
char a[1010][1010];
char b[1010][1010];
int n, m;
int flag;
bool cmp()
{for (int i = 1; i <= n; i++)for (int j = 1; j <= m; j++)if (a[i][j] != b[i][j])return false;return true;
}
void dfs(int x, int y)
{flag = 1;int next[8][2] = { {1,1},{-1,-1},{-1,0},{1,0},{0,1},{0,-1},{1,-1},{-1,1} };for (int i = 0; i < 8; i++){int tx = x + next[i][0];int ty = y + next[i][1];if (tx<1 || ty<1 || tx>n || ty>m){flag = 0;return;}if (a[tx][ty] != '#'){flag = 0;break;}}if (!flag)return;for (int i = 0; i < 8; i++){int tx = x + next[i][0];int ty = y + next[i][1];b[tx][ty] = '#';}
}
int main()
{ios::sync_with_stdio(false);cin.tie(nullptr);cin >> n >> m;for (int i = 1; i <= n; i++)for (int j = 1; j <= m; j++){cin >> a[i][j];b[i][j] = '.';}for (int i = 1; i <= n; i++)for (int j = 1; j <= m; j++){dfs(i, j);}if (cmp())cout << "YES";else{cout << "NO";}return 0;
}

P1460 [USACO2.1] 健康的荷斯坦奶牛 Healthy Holsteins - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)

思路:

开始没写出来,看了题解后有了一些头绪(感觉应该有普及+的难度了)。

用数组记录需要种类数的最小量和不同饲料不同种类的最小量,

从第一种饲料开始进入搜索,每次搜索进行一次判断,若饲料数已超过数据则马上结束这一次搜索(对当前饲料进行搜索,用数组记录),得到需要的饲料数,并用数组存起来所需的饲料编号,对所有饲料的相同一种的维他命进行判断,得到最优解,继续进行搜索有两种可能(一是不算当前饲料,即饲料数加1,但是所需饲料数不加1,二是当前饲料数和所需饲料数都加1),最后所有搜索结束后按照题目要求输出即可

AC:

#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<vector>
#include<math.h>
#include <stdio.h>
using namespace std;
typedef long long ll;
inline int read()
{int k = 0, f = 1; char ch = getchar();while (ch < '0' || ch>'9'){if (ch == '-')f = -1;ch = getchar();}while (ch >= '0' && ch <= '9'){k = k * 10 + ch - '0';ch = getchar();}return k * f;
}
int a[1010];
int b[1010][1010];
int ans[1010];
int n, m, k=20;
int s[1010];
bool judge(int x)
{for (int i = 1; i <= n; i++){int sum = 0;for (int j = 1; j <= x; j++){sum += b[s[j]][i];}if (sum < a[i])return false;}return true;
}
void dfs(int pos, int num)
{if (pos > m){if (judge(num) && num < k){k = num;for (int i = 1; i <=  num; i++){ans[i] = s[i];}}return;}s[num + 1] = pos;dfs(pos + 1, num + 1);dfs(pos + 1, num);
}
int main()
{ios::sync_with_stdio(false);cin.tie(nullptr);cin >> n;for (int i = 1; i <= n; i++){cin >> a[i];}cin >> m;for (int i = 1; i <= m; i++){for (int j = 1; j <= n; j++){cin >> b[i][j];}}dfs(1, 0);cout << k << " ";for (int i = 1; i <= k; i++)cout << ans[i] << " ";cout << endl;return 0;
}

01背包思路(太久远了,忘了)

来几道板子题唤醒一下沉睡的记忆

P1060 [NOIP2006 普及组] 开心的金明 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)

AC:

#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<vector>
#include<math.h>
#include <stdio.h>
using namespace std;
typedef long long ll;
inline int read()
{int k = 0, f = 1; char ch = getchar();while (ch < '0' || ch>'9'){if (ch == '-')f = -1;ch = getchar();}while (ch >= '0' && ch <= '9'){k = k * 10 + ch - '0';ch = getchar();}return k * f;
}
int v[100010], w[100010];
int dp[1010][30010];
int main()
{ios::sync_with_stdio(false);cin.tie(nullptr);int n, m;cin >> n >> m;for (int i = 1; i <= m; i++){cin >> v[i] >> w[i];w[i] = w[i] * v[i];}for (int i = 1; i <= m; i++){for (int j = 1; j <= n; j++){if (v[i] > j){dp[i][j] = dp[i - 1][j];}else{dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - v[i]] + w[i]);}}}cout << dp[m][n];return 0;
}

P1049 [NOIP2001 普及组] 装箱问题 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)

AC:

#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<vector>
#include<math.h>
#include <stdio.h>
using namespace std;
typedef long long ll;
inline int read()
{int k = 0, f = 1; char ch = getchar();while (ch < '0' || ch>'9'){if (ch == '-')f = -1;ch = getchar();}while (ch >= '0' && ch <= '9'){k = k * 10 + ch - '0';ch = getchar();}return k * f;
}
int dp[35][20010];
int w[20010];
int main()
{ios::sync_with_stdio(false);cin.tie(nullptr);int v, n;cin >> v >> n;for (int i = 1; i <= n; i++){cin >> w[i];}for (int i = 1; i <= n; i++){for (int j = 1; j <= v; j++){if (w[i] > j){dp[i][j] = dp[i - 1][j];}else{dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w[i]]+w[i]);}}}cout << v-dp[n][v];return 0;
}

P1048 [NOIP2005 普及组] 采药 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)

#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<vector>
#include<math.h>
#include <stdio.h>
using namespace std;
typedef long long ll;
inline int read()
{int k = 0, f = 1; char ch = getchar();while (ch < '0' || ch>'9'){if (ch == '-')f = -1;ch = getchar();}while (ch >= '0' && ch <= '9'){k = k * 10 + ch - '0';ch = getchar();}return k * f;
}
int w[110];
int t[1100];
int dp[110][1100];
int main()
{ios::sync_with_stdio(false);cin.tie(nullptr);int n, m;cin >> n >> m;for (int i = 1; i <= m; i++){cin >> t[i] >> w[i];}for (int i = 1; i <= m; i++){for (int j = 1; j <= n; j++){if (t[i] > j)dp[i][j] = dp[i - 1][j];else{dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - t[i]] + w[i]);}}}cout << dp[m][n];return 0;
}

分组背包问题(卡了半天也并不知道哪错了,无语)

P1757 通天之分组背包 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)

#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<vector>
#include<math.h>
#include <stdio.h>
using namespace std;
typedef long long ll;
inline int read()
{int k = 0, f = 1; char ch = getchar();while (ch < '0' || ch>'9'){if (ch == '-')f = -1;ch = getchar();}while (ch >= '0' && ch <= '9'){k = k * 10 + ch - '0';ch = getchar();}return k * f;
}
int a[1010], b[1010], c[1010];
int dp[1010];
int g[1010][1010];
int main()
{ios::sync_with_stdio(false);cin.tie(nullptr);int n, m, t, x = 0;cin >> m >> n;for (int i = 1; i <= n; i++){cin >> a[i] >> b[i] >> t;x = max(t, x);c[t]++;g[t][c[t]] = i;}for (int i = 1; i <= x; i++)//小组{for (int j = m; j >= 0; j--)//容量{for (int k = 1; k <= c[i]; k++)//小组成员{if(a[g[i][k]]<=j)dp[j] = max(dp[j], dp[j - a[g[i][k]]] + b[g[i][k]]);}}}cout << dp[m] << endl;return 0;
}
http://www.hkea.cn/news/804018/

相关文章:

  • 做logo什么网站昆明百度关键词优化
  • 怎样做省钱购物网站sem推广代运营
  • 英文网站开发公司万网阿里云域名查询
  • 做调查问卷网挣钱的网站新闻 今天
  • 网站建设工作小组在线建站平台免费建网站
  • 可以发广告的网站湖南seo推广系统
  • 大丰网站建设哪家好成都seo
  • 学校网站建设项目的wbsseo交流qq群
  • 筑梦网站建设西安百度竞价开户
  • 个体营业执照可以做网站搞推广吗推广网站制作
  • 公共交通公司网站建设方案移动慧生活app下载
  • 国内开源代码网站搜了网推广效果怎么样
  • html5 metro风格网站模板今日新闻事件
  • 网站不在首页显示出来做网络推广
  • 上海网站seo公司网页推广平台
  • 网站服务器租用价格表百度怎么发布自己的广告
  • 经纪人做网站技巧搜索引擎入口yandex
  • 教育网站制作哪家服务好全球外贸采购网
  • 响应式网络网站源码百度关键词查询网站
  • 南京网站制作设计公司网络运营团队
  • 阿里巴巴上怎样做自己的网站seo网站优化网站编辑招聘
  • 网站做付费推广都需要问什么网络热词2022
  • 给男票做网站表白的软件产品市场推广计划书
  • 西安网站制作定制怎么制作自己的个人网站
  • wordpress 如何移动端盐城seo优化
  • asp.net 制作网站开发百度竞价排名软件
  • 百度爱采购推广平台天津网络推广seo
  • 福州市闽侯县建设局网站推广引流吸引人的文案
  • wordpress目录 读写权限泰安短视频seo
  • 东莞建设网站流程澎湃新闻