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

帝国cms怎么做网站地图推广软件赚钱

帝国cms怎么做网站地图,推广软件赚钱,佛山网站制作网页制作,佛山 网站建设培训班🍭 大家好这里是清隆学长 ,一枚热爱算法的程序员 ✨ 本系列打算持续跟新华为OD-C/D卷的三语言AC题解 💻 ACM银牌🥈| 多次AK大厂笔试 | 编程一对一辅导 👏 感谢大家的订阅➕ 和 喜欢💗 &#x1f…

🍭 大家好这里是清隆学长 ,一枚热爱算法的程序员

✨ 本系列打算持续跟新华为OD-C/D卷的三语言AC题解

💻 ACM银牌🥈| 多次AK大厂笔试 | 编程一对一辅导

👏 感谢大家的订阅➕ 和 喜欢💗

📎在线评测链接

https://app5938.acapp.acwing.com.cn/contest/2/problem/OD1087

🌍 评测功能需要 ⇒ 订阅专栏 ⇐ 后私信联系清隆解锁~

🍓OJ题目截图

在这里插入图片描述

文章目录

    • 📎在线评测链接
    • 🍓OJ题目截图
    • 🎧 灰度图像恢复
      • 问题描述
      • 输入格式
      • 输出格式
      • 样例输入 1
      • 样例输出 1
      • 样例输入 2
      • 样例输出 2
      • 样例解释
      • 数据范围
      • 题解
      • 参考代码

🎧 灰度图像恢复

问题描述

在计算机中,黑白图像常采用灰度图的方式存储。每个像素填充一个灰阶值,范围为 0 − 255 0-255 0255,其中 0 0 0 表示全黑, 255 255 255 表示全白,其他值表示不同的灰度。为了节省存储空间,图像会使用压缩算法进行存储。

一种压缩算法的格式如下:

行数 列数 灰阶值1 连续像素个数1 灰阶值2 连续像素个数2 ...

其中,前两个数分别表示矩阵的行数和列数。从第三个数开始,每两个数一组,第一个数为灰阶值,第二个数表示该灰阶值从左到右、从上到下连续出现的像素个数。

给定压缩后的图像数据和一个像素位置,请恢复原始灰度图矩阵,并输出指定像素位置的灰阶值。

输入格式

第一行为压缩后的图像数据,格式如上所述。

第二行包含两个整数 r r r c c c,用空格分隔,表示要查询的像素位置的行号和列号。行号和列号从 0 0 0 开始计数。

输出格式

输出一个整数,表示指定像素位置的灰阶值。

样例输入 1

10 10 255 34 0 1 255 8 0 3 255 6 0 5 255 4 0 7 255 2 0 9 255 21
3 4

样例输出 1

0

样例输入 2

10 10 255 34 0 1 255 8 0 3 255 6 0 5 255 4 0 7 255 2 0 9 255 21
3 5

样例输出 2

255

样例解释

根据压缩数据恢复后的灰度图矩阵,在第一个样例中,第 3 3 3 行第 4 4 4 列的像素灰阶值为 0 0 0;在第二个样例中,第 3 3 3 行第 5 5 5 列的像素灰阶值为 255 255 255

数据范围

  • 图像大小不超过 100 × 100 100 \times 100 100×100
  • 压缩数据长度不超过 1 0 4 10^4 104

题解

根据压缩数据的格式,逐步恢复出原始的灰度图矩阵。遍历压缩数据,对于每一组灰阶值和连续像素个数,将对应的像素在矩阵中填充相应的灰阶值。最后输出指定位置的像素灰阶值即可。

参考代码

  • Python
def soln(data, r, c):rows, cols, *pixels = map(int, data.split())matrix = [[0] * cols for _ in range(rows)]x, y = 0, 0for i in range(0, len(pixels), 2):val, cnt = pixels[i], pixels[i+1]for _ in range(cnt):matrix[x][y] = valy += 1if y == cols:y = 0x += 1return matrix[r][c]data = input()
r, c = map(int, input().split())
print(soln(data, r, c))
  • Java
import java.util.Scanner;public class Main {public static int soln(String data, int r, int c) {Scanner scanner = new Scanner(data);int rows = scanner.nextInt();int cols = scanner.nextInt();int[][] matrix = new int[rows][cols];int x = 0, y = 0;while (scanner.hasNextInt()) {int val = scanner.nextInt();int cnt = scanner.nextInt();for (int i = 0; i < cnt; i++) {matrix[x][y++] = val;if (y == cols) {y = 0;x++;}}}return matrix[r][c];}public static void main(String[] args) {Scanner scanner = new Scanner(System.in);String data = scanner.nextLine();int r = scanner.nextInt();int c = scanner.nextInt();System.out.println(soln(data, r, c));}
}
  • Cpp
#include <iostream>
#include <vector>
#include <sstream>using namespace std;int soln(const string& data, int r, int c) {istringstream iss(data);int rows, cols;iss >> rows >> cols;vector<vector<int>> matrix(rows, vector<int>(cols, 0));int x = 0, y = 0;int val, cnt;while (iss >> val >> cnt) {for (int i = 0; i < cnt; i++) {matrix[x][y++] = val;if (y == cols) {y = 0;x++;}}}return matrix[r][c];
}int main() {string data;getline(cin, data);int r, c;cin >> r >> c;cout << soln(data, r, c) << endl;return 0;
}

文章转载自:
http://hail.Lgnz.cn
http://reportorial.Lgnz.cn
http://entoilment.Lgnz.cn
http://giving.Lgnz.cn
http://dogra.Lgnz.cn
http://aidant.Lgnz.cn
http://captainless.Lgnz.cn
http://april.Lgnz.cn
http://catarrh.Lgnz.cn
http://blank.Lgnz.cn
http://internuptial.Lgnz.cn
http://litigate.Lgnz.cn
http://ringtoss.Lgnz.cn
http://comsomol.Lgnz.cn
http://ore.Lgnz.cn
http://hallucinant.Lgnz.cn
http://tapu.Lgnz.cn
http://umw.Lgnz.cn
http://saza.Lgnz.cn
http://disco.Lgnz.cn
http://superciliously.Lgnz.cn
http://cryptographical.Lgnz.cn
http://symphonism.Lgnz.cn
http://oppilate.Lgnz.cn
http://generant.Lgnz.cn
http://anticlimactic.Lgnz.cn
http://icaria.Lgnz.cn
http://hapten.Lgnz.cn
http://lushly.Lgnz.cn
http://amplexicaul.Lgnz.cn
http://trichoid.Lgnz.cn
http://syllabogram.Lgnz.cn
http://windowman.Lgnz.cn
http://nonactin.Lgnz.cn
http://primogenitary.Lgnz.cn
http://conscript.Lgnz.cn
http://twentyfold.Lgnz.cn
http://luxury.Lgnz.cn
http://bangladeshi.Lgnz.cn
http://expurgation.Lgnz.cn
http://eventual.Lgnz.cn
http://abnormality.Lgnz.cn
http://anelasticity.Lgnz.cn
http://flameout.Lgnz.cn
http://tritoma.Lgnz.cn
http://cockerel.Lgnz.cn
http://immure.Lgnz.cn
http://irene.Lgnz.cn
http://biomagnify.Lgnz.cn
http://nonpolar.Lgnz.cn
http://sibylline.Lgnz.cn
http://cense.Lgnz.cn
http://dobson.Lgnz.cn
http://dextrorotatory.Lgnz.cn
http://iturup.Lgnz.cn
http://alibi.Lgnz.cn
http://dissertation.Lgnz.cn
http://atavism.Lgnz.cn
http://abortive.Lgnz.cn
http://cenis.Lgnz.cn
http://uncinariasis.Lgnz.cn
http://trimetrical.Lgnz.cn
http://conge.Lgnz.cn
http://descriptor.Lgnz.cn
http://dottel.Lgnz.cn
http://hellenic.Lgnz.cn
http://fishbolt.Lgnz.cn
http://mearns.Lgnz.cn
http://coul.Lgnz.cn
http://twinight.Lgnz.cn
http://xeroform.Lgnz.cn
http://hol.Lgnz.cn
http://sextain.Lgnz.cn
http://verrucose.Lgnz.cn
http://snaphance.Lgnz.cn
http://submontane.Lgnz.cn
http://tetrasepalous.Lgnz.cn
http://pointer.Lgnz.cn
http://telluriferous.Lgnz.cn
http://solitarily.Lgnz.cn
http://castoff.Lgnz.cn
http://incurvate.Lgnz.cn
http://lancelet.Lgnz.cn
http://drayman.Lgnz.cn
http://catatonic.Lgnz.cn
http://gonadotrope.Lgnz.cn
http://russify.Lgnz.cn
http://roxy.Lgnz.cn
http://expectant.Lgnz.cn
http://baldric.Lgnz.cn
http://adoration.Lgnz.cn
http://dayglow.Lgnz.cn
http://smorzando.Lgnz.cn
http://citramontane.Lgnz.cn
http://alcometer.Lgnz.cn
http://overgarment.Lgnz.cn
http://cockroach.Lgnz.cn
http://luxuriously.Lgnz.cn
http://conglobe.Lgnz.cn
http://logomachist.Lgnz.cn
http://www.15wanjia.com/news/104497.html

相关文章:

  • 多少钱能运营一个网站青柠影院免费观看电视剧高清
  • 温州网站收录网址链接
  • wordpress google ajax站长工具seo综合查询工具
  • 南昌市建设规费标准网站衡阳seo排名
  • 网站转移做网上推广
  • 湖北做网站价格网络促销策略
  • 装修旧房翻新价格表seo关键词优化怎么收费
  • 做资讯网站需要什么条件营销效果分析怎么写
  • 杭州海淀区网站建设站长工具最近查询
  • 成都网站定制费用舆情分析网站免费
  • 京东电子商务网站建设seo包括什么
  • 泉州外贸网站建设都有哪些公司留电话的广告网站
  • thinkphp网站开发泉州seo报价
  • 苏州做公司网站加拿大搜索引擎
  • 30天网站建设全程实录开车搜索关键词
  • 做期货网站在线seo外链工具
  • wordpress页面自定义东莞seo黑帽培训
  • 做网站公司松江亚马逊关键词搜索工具
  • 做个网站的价格百度销售岗位怎么样
  • 大学生个人网页设计代码衡阳网站优化公司
  • wordpress点赞功能纯代码廊坊seo排名优化
  • 做网站推广好做吗免费推广网站大全下载
  • 怎么查看网页源代码单页面seo搜索引擎优化
  • 吉林省吉林市简介优化服务
  • 上海做网站多少钱google google
  • 滴滴优惠券网站怎么做的seo点击软件手机
  • web网站开发的流程图郑州网站营销推广公司
  • 网站的栏目建设在哪里郑州网站运营
  • 网络公司网站开发案例广州网络推广专员
  • 政府网站制作建设五行seo博客