公司让我做网站负责人电子商务网站建设需要什么

news/2025/10/2 12:33:09/文章来源:
公司让我做网站负责人,电子商务网站建设需要什么,合肥 网站运营,阿里云建站视频教程[ICPC2021 Nanjing R] Klee in Solitary Confinement 题面翻译 给定 n , k n,k n,k 和一个长为 n n n 的序列#xff0c;你可以选择对区间 [ l , r ] [l, r] [l,r] 的数整体加上 k k k#xff0c;也可以不加。最大化众数出现次数并输出。 题目描述 Since the travele…[ICPC2021 Nanjing R] Klee in Solitary Confinement 题面翻译 给定 n , k n,k n,k 和一个长为 n n n 的序列你可以选择对区间 [ l , r ] [l, r] [l,r] 的数整体加上 k k k也可以不加。最大化众数出现次数并输出。 题目描述 Since the traveler comes, People in Monstadt suddenly raise great interest in computer programming and algorithms, including Klee, the Spark Knight of the Knights of Favonius. Being sent to solitary confinement by Jean again, Klee decides to spend time learning the famous Mo’s algorithm, which can compute with a time complexity of O ( n 1.5 ) \mathcal{O}(n^{1.5}) O(n1.5) for some range query problem without modifications. To check whether Klee has truly mastered the algorithm (or in fact making another bombs secretly), Jean gives her a problem of an integer sequence a 1 , a 2 , ⋯ , a n a_1, a_2, \cdots, a_n a1​,a2​,⋯,an​ along with some queries [ l i , r i ] [l_i, r_i] [li​,ri​] requiring her to find the mode number in the contiguous subsequence a l i , a l i 1 , ⋯ , a r i a_{l_i}, a_{l_i 1}, \cdots, a_{r_i} ali​​,ali​1​,⋯,ari​​. The mode number is the most common number (that is to say, the number which appears the maximum number of times) in the subsequence. With the help of Mo’s algorithm, Klee solves that problem without effort, but another problem comes into her mind. Given an integer sequence a 1 , a 2 , ⋯ , a n a_1, a_2, \cdots, a_n a1​,a2​,⋯,an​ of length n n n and an integer k k k, you can perform the following operation at most once: Choose two integers l l l and r r r such that 1 ≤ l ≤ r ≤ n 1 \le l \le r \le n 1≤l≤r≤n and add k k k to every a i a_i ai​ where l ≤ i ≤ r l \le i \le r l≤i≤r. Note that it is OK not to perform this operation. Compute the maximum occurrence of the mode number of the whole sequence if you choose to perform (or not perform) the operation optimally. 输入格式 There is only one test case in each test file. The first line of the input contains two integers n n n and k k k ( 1 ≤ n ≤ 1 0 6 1 \le n \le 10^6 1≤n≤106, − 1 0 6 ≤ k ≤ 1 0 6 -10^6 \le k \le 10^6 −106≤k≤106) indicating the length of the sequence and the additive number. The second line of the input contains n n n integers a 1 , a 2 , ⋯ , a n a_1, a_2, \cdots, a_n a1​,a2​,⋯,an​ ( − 1 0 6 ≤ a i ≤ 1 0 6 -10^6 \le a_i \le 10^6 −106≤ai​≤106) indicating the original sequence. 输出格式 Output one line containing one integer indicating the maximum occurrence of the mode number of the whole sequence after performing (or not performing) the operation. 样例 #1 样例输入 #1 5 2 2 2 4 4 4样例输出 #1 5样例 #2 样例输入 #2 7 1 3 2 3 2 2 2 3样例输出 #2 6样例 #3 样例输入 #3 7 1 2 3 2 3 2 3 3样例输出 #3 5样例 #4 样例输入 #4 9 -100 -1 -2 1 2 -1 -2 1 -2 1样例输出 #4 3提示 For the first sample test case, choose l 1 l 1 l1 and r 2 r 2 r2 and we’ll result in the sequence { 4 , 4 , 4 , 4 , 4 } \{4, 4, 4, 4, 4\} {4,4,4,4,4}. The mode number is obviously 4 4 4 which appears 5 5 5 times. For the second sample test case, choose l 4 l 4 l4 and r 6 r 6 r6 and we’ll result in the sequence { 3 , 2 , 3 , 3 , 3 , 3 , 3 } \{3, 2, 3, 3, 3, 3, 3\} {3,2,3,3,3,3,3}. The mode number is 3 3 3 which appears 6 6 6 times. For the fourth sample test case, choose not to perform the operation. The mode number is 1 1 1 and − 2 -2 −2 which both appear 3 3 3 times. 以上来自洛谷 以上来自洛谷 以上来自洛谷 看完题目知道我为什么说”原神启动“了吧。什么不知道一看你就没看这篇题解。 重点声明我不玩原神。 解题思路 这一套 ICPC 的问题全是关于原神的诶出题人什么了 正片开始 我们枚举最后众数为 x x x则每次只需要单独考虑 x x x 和 x k xk xk。我们事先可以将每个数按数值大小将位置插入 vector则可做到均摊 O ( n ) O(n) O(n)。如果使用 m a p map map 或者别的容器实现则有运行超时的风险。 现在问题转化成有一个长度为 m m m 的序列序列仅由 X X X 和 Y Y Y 组成用 X l , r X_{l,r} Xl,r​ 和 Y l , r Y_{l,r} Yl,r​​ 表示区间 [ l , r ] [l,r] [l,r] 里 X X X 和 Y Y Y 的个数则我们需要选择一个区间 [ l , r ] [l,r] [l,r]使得 X 1 , l − 1 Y l , r X r 1 , m X_{1,l−1}Y_{l,r}X_{r1,m} X1,l−1​Yl,r​Xr1,m​ 最大。 简单转化一下则对于每一个 r r r我们需要最大化 X 1 , l − 1 Y l , r X r 1 , m X 1 , l − 1 ( r − l 1 ) − X l , r X r 1 , m X_{1,l−1}Y_{l,r}X_{r1,m}X_{1,l−1}(r−l1)−X_{l,r}X_{r1,m} X1,l−1​Yl,r​Xr1,m​X1,l−1​(r−l1)−Xl,r​Xr1,m​​。整理得到 ( 2 × X 1 , l − 1 − l ) ( r 1 − X 1 , r X r 1 , m ) (2\times X_{1,l−1}−l)(r1−X_{1,r}X_{r1,m}) (2×X1,l−1​−l)(r1−X1,r​Xr1,m​)即最大化 2 × X 1 , l − 1 − l 2\times X_{1,l−1}−l 2×X1,l−1​−l记录前缀最大值转移即可时间复杂度 O ( m ) O(m) O(m)。综上时间复杂度为 O ( n ) O(n) O(n)。 然后去写代码复制到提交代码出点击提交就会 A C AC AC ? AC Code #include bits/stdc.h using namespace std; #define int long long const int Maxn 1e6 5; int n, k, a[Maxn]; int tong[Maxn * 4][2], maxx, len; vectorint res[Maxn * 4]; int ans; inline void work() {cin n k;for (int i 1; i n; i) {cin a[i];a[i] 2e6;res[a[i]].push_back(a[i]);res[a[i] k].push_back(a[i]);len max(len, a[i] k);maxx max({maxx, (int)res[a[i]].size(), (int)res[a[i] k].size()});}if (!k) {cout maxx / 2 endl;return;}int tmp;for (int i 0; i len; i) {if (res[i].size() 0) {continue;}for (int j 0; j res[i].size(); j) {tong[j 1][0] tong[j][0] (res[i][j] i);tong[j 1][1] tong[j][1] (res[i][j] ! i);}tmp tong[1][0] - tong[1][1];for (int j 1; j res[i].size(); j) {tmp max(tmp, tong[j - 1][0] - tong[j - 1][1]);ans max(ans, tong[res[i].size()][0] tong[j][1] - tong[j][0] tmp);}}cout ans endl; } signed main() {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);work();return 0; }

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/924897.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

物品“复活”软件开发过程(第一版)

物品“复活”软件开发过程(第一版)| 环节 | 完成时间(h) | | 计划 | 0.5 | | 分析需求 | 0.5 | | 设计文档 | 1 | | 代码规范 | 0.5 | | 具体设计 | 0.5 …

怎样做展会推广网站pc端购物网站建站

我正在努力构建将应用程序的* .csv文件与理想的保管箱帐户同步的机会.我到目前为止做了什么>清单中的权限和com.dropbox.client2.android.AuthActivity>使用我的发行商店签署了我的应用程序>执行一些代码来检查保管箱服务问题是我不明白我在哪里可以得到APP_KEY和SECR…

卖表网站源码长沙住建

问题: 给定一个二叉树的根节点 root ,返回它的 中序 遍历。 示例 1: 输入:root [1,null,2,3] 输出:[1,3,2] 示例 2: 输入:root [] 输出:[] 示例 3: 输入&…

docker 安装 - 详解

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

详细介绍:机器学习+数字孪生:从诊断到自主决策的跨越

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

深入解析:[linux仓库]深入解析Linux动态链接与动态库加载:理解背后的原理与技巧

深入解析:[linux仓库]深入解析Linux动态链接与动态库加载:理解背后的原理与技巧pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font…

AI行业应用:金融、医疗、教育、制造业的落地实践与技术创新 - 实践

AI行业应用:金融、医疗、教育、制造业的落地实践与技术创新 - 实践pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: &quo…

北京微信网站开发报价工商局网站清算组备案怎么做

前言 2022 年 6 月 15 日,信通院在中国信通院云原生产业大会上发布《基于无服务器架构的工具链能力要求》标准,至此全球首个云原生 Serverless 开放工具链模型正式发布!Serverless Devs [1]作为开源开放的开发者工具积极参与工具链模型建设&…

vue3 知识点快速入门整理

vue3 知识点快速入门整理vue3知识整合视频讲解参考: 上尚硅谷Vue3入门到实战:https://www.bilibili.com/video/BV1Za4y1r7KE/?spm_id_from=333.337.search-card.all.click&vd_source=ef0d33a686084368f4ac59c8a…

红色面纱

复兴,复兴。 口号响彻很久,然而前路始终没有头。口号真是个天才的发明,它让喊它听它的人们始终保有一种无厘头的亢奋。这样的亢奋出自原始的冲动本能,在一些特定时候确确实实能出现一些意想不到的奇迹。只是这样的…

创建 SQL Server 数据库

use master go-- 如果存在这个数据库名称 ,否则删除 if exists(select * from sysdatabases where name = MyFirstDB) drop database MyFirstDB-- 创建数据库 create database MyFirstDB on primary (name=MyFirstDB_…

网站友情链接很重要吗做公众号主页面的有哪些网站

线上OJ: 一本通:http://ybt.ssoier.cn:8088/problem_show.php?pid1417\ 核心思想 首先、本题中提到 “ 至少 要花多少金币改造机器人,能获得 至少 k分 ”。看到这样的话语,基本可以考虑要使用 二分答案。 那么,本题中…

2025上海殡葬一条龙服务优质推荐:福孝堂文化用品公司贴心之

2025上海殡葬一条龙服务优质推荐:福孝堂文化用品公司贴心之选在上海这座繁华都市,殡葬一条龙服务承载着对逝者的尊重和对生者的慰藉。随着社会的发展,人们对殡葬服务的质量和专业性提出了更高要求。然而,当前上海殡…

2025上海寿衣厂家推荐福孝堂,专注传统工艺与贴心服务

2025上海寿衣厂家推荐福孝堂,专注传统工艺与贴心服务在当代社会,随着人口老龄化程度不断加深,殡葬用品行业面临着前所未有的技术挑战。据统计数据显示,上海地区年殡葬服务需求量呈现稳定增长趋势,其中寿衣作为重要…

wordpress中文站微网站用什么做的

块元素的特点 1.支持所有样式 2.块级元素 独占一行 3.块级元素默认宽度和父元素一样 常用块元素块级元素 一般 div p ol ul h1-h6 li dl dt dd 等都是 初始化(样式重置) 1.实际开发中,我们会把这些默认的样式在样式定义开头清除掉,清除掉这些默认样式&…

2025上海骨灰盒厂家推荐,福孝堂专业定制与暖心服务口碑之选

2025上海骨灰盒厂家推荐,福孝堂专业定制与暖心服务口碑之选在当代殡葬服务领域,骨灰盒作为承载逝者尊严与生者哀思的重要载体,其品质与服务的专业性日益受到社会各界的关注。随着2025年的临近,上海地区的殡葬服务行…

IDEA 2024 中创建 Maven 项目的详细步骤 - 指南

IDEA 2024 中创建 Maven 项目的详细步骤 - 指南pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", &…

房地产网站的设计要求网站开发招标文件

文章目录 1. 概念介绍2. 使用方法2.1 基本用法2.2 缓冲原理 3. 示例代码4. 内容总结 我们在上一章回中介绍了"FadeInImage组件"相关的内容,本章回中将介绍CachedNetworkImage组件.闲话休提,让我们一起Talk Flutter吧。 1. 概念介绍 我们在本章…

公司网站制作方案关于重新建设网站的请示

戳蓝字“CSDN云计算”关注我们哦!Spring是为解决企业应用程序开发复杂性而创建的一个Java开源框架,应用非常广泛。业内非常流行的SSH架构中的其中一个"S"指的就是Spring。今天我们就一起来看看关于Spring的精华问答!1Q:…

【Groovy】流程控制

1 选择结构 ​ Groovy 中选择结构主要包含 if -else、switch 语句,并且可以返回结果。 1.1 if-else def score = 85 if (score >= 90) {println("优秀") } else if (score >= 80) {println("…