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

西安网站排名分析2024百度下载

西安网站排名分析,2024百度下载,国内永久crm不需要下载app,wordpress视频无法播放视频题目: 样例: 输入 3 5 1 2 3 4 5 3 3 3 3 3 1 2 1 输出 16 1 3 思路: 依据题意,再看数据范围,可以知道暴力肯定是不可能了,然后通过题目意思,我们可以排列模拟一下,这里排列所得结…

题目:

样例:

输入
3
5
1 2 3 4 5
3
3 3 3
3
1 2 1

输出
16
1
3

思路:

        依据题意,再看数据范围,可以知道暴力肯定是不可能了,然后通过题目意思,我们可以排列模拟一下,这里排列所得结果,联系上我们数学的排列组合知识点可以知道,这个山峰序列,我们排列的时候是围绕 “山峰” 来进行排列,即围绕最大的数值来进行排列,而当出现多个最大值的时候,我们必须将多个最大值绑定在一块,通过排列得知,我们排列左边是一个结果,排列一样的右边,也是一种结果,所以有 (排列个数 + 1)这里的 +1 是排列右边的结果,相当于镜面翻转。

其次,答案中至少有一种结果,即ans = 1,因为直接 sort 排序一遍,就是一个山峰序列,然后当我们记录的 (排列个数 + 1)就有最终答案 ans = ans * (排列个数 + 1) % MOD 这里注意一个条件就是我们的山峰序列是围绕的,所以不用算进 ans = ans * (排列个数 + 1) % MOD

例子1: 

 [1 , 2 ]   

ans = 1   

r[1] = 1

r[2] = 1
ans = ans * (r[1] + 1) % MOD = 2

即答案只有 2 种分别是  [1 , 2 ]   [2, 1 ]   

代码详解如下:

#include <iostream>
#include <unordered_map>
#define endl '\n'
#define x first
#define y second
#define int long long
#define YES puts("YES")
#define NO puts("NO")
#define umap unordered_map
#pragma GCC optimize(3,"Ofast","inline")
#define ___G std::ios::sync_with_stdio(false),cin.tie(0), cout.tie(0)
using namespace std;
const int MOD = 998244353;
int n;	// 数组大小
inline void solve()
{umap<int,int>r;	// 记录元素个数int ans = 1;	// 答案最终结果int maxs = -1;	// 取出  峰顶值 即 最大值cin >> n;for(int i = 0,x;i < n;++i){cin >> x;++r[x];	// 统计元素个数maxs = max(maxs,x);		// 寻找 峰顶值}// 开始循环乘上每一种排列结果, 除去峰顶值的计算for(auto i : r) if(i.x != maxs) ans = ans * (i.y + 1) % MOD;// 输出答案cout << ans << endl;
}signed main()
{
//	freopen("a.txt", "r", stdin);___G;int _t = 1;cin >> _t;while (_t--){solve();}return 0;
}

最后提交:


文章转载自:
http://dinncojoltily.wbqt.cn
http://dinncodaedalean.wbqt.cn
http://dinncoside.wbqt.cn
http://dinncovaricosity.wbqt.cn
http://dinncosyncopate.wbqt.cn
http://dinncoblague.wbqt.cn
http://dinncostagestruck.wbqt.cn
http://dinncoacoustic.wbqt.cn
http://dinncopremises.wbqt.cn
http://dinncoagrarian.wbqt.cn
http://dinncofrench.wbqt.cn
http://dinncoautomatize.wbqt.cn
http://dinncobaric.wbqt.cn
http://dinncodpi.wbqt.cn
http://dinncofanciless.wbqt.cn
http://dinncovirosis.wbqt.cn
http://dinncoanyways.wbqt.cn
http://dinncoskean.wbqt.cn
http://dinncofelting.wbqt.cn
http://dinncopiecemeal.wbqt.cn
http://dinncocountertenor.wbqt.cn
http://dinncorevitalization.wbqt.cn
http://dinncoreluctation.wbqt.cn
http://dinncoirresistibility.wbqt.cn
http://dinncowatershoot.wbqt.cn
http://dinncohornstone.wbqt.cn
http://dinncovictorian.wbqt.cn
http://dinncobemoisten.wbqt.cn
http://dinncoungifted.wbqt.cn
http://dinncocorrasive.wbqt.cn
http://dinncoshrewish.wbqt.cn
http://dinncopigg.wbqt.cn
http://dinncoaerolitics.wbqt.cn
http://dinncokiwi.wbqt.cn
http://dinncokmps.wbqt.cn
http://dinncoroving.wbqt.cn
http://dinncoterrel.wbqt.cn
http://dinncobloodshot.wbqt.cn
http://dinncopejorative.wbqt.cn
http://dinncodrupaceous.wbqt.cn
http://dinncopmo.wbqt.cn
http://dinncoafficionado.wbqt.cn
http://dinncocud.wbqt.cn
http://dinncoalveolar.wbqt.cn
http://dinncoage.wbqt.cn
http://dinncopantagruelist.wbqt.cn
http://dinncoprocrypsis.wbqt.cn
http://dinncoconditional.wbqt.cn
http://dinncomorphotropy.wbqt.cn
http://dinncoupbringing.wbqt.cn
http://dinncounderhanded.wbqt.cn
http://dinncomediography.wbqt.cn
http://dinncofeminacy.wbqt.cn
http://dinncosulfhydryl.wbqt.cn
http://dinncospiritedness.wbqt.cn
http://dinncohymeneal.wbqt.cn
http://dinncounsaid.wbqt.cn
http://dinncowondrously.wbqt.cn
http://dinncounwise.wbqt.cn
http://dinncoanalogical.wbqt.cn
http://dinncobarramundi.wbqt.cn
http://dinncopyrophotometer.wbqt.cn
http://dinncosentient.wbqt.cn
http://dinncobloomy.wbqt.cn
http://dinncosubcenter.wbqt.cn
http://dinncomailing.wbqt.cn
http://dinncochoriamb.wbqt.cn
http://dinncoreactive.wbqt.cn
http://dinncopom.wbqt.cn
http://dinncotrepidation.wbqt.cn
http://dinncogimlet.wbqt.cn
http://dinncoeightball.wbqt.cn
http://dinncofabulously.wbqt.cn
http://dinncoclwyd.wbqt.cn
http://dinncoaggrieve.wbqt.cn
http://dinncoendophilic.wbqt.cn
http://dinncojereed.wbqt.cn
http://dinncometamorphism.wbqt.cn
http://dinncoagee.wbqt.cn
http://dinncoresplend.wbqt.cn
http://dinncolindgrenite.wbqt.cn
http://dinncobarbary.wbqt.cn
http://dinncoinobservantly.wbqt.cn
http://dinncoplayfully.wbqt.cn
http://dinncosiderography.wbqt.cn
http://dinncothrob.wbqt.cn
http://dinncolz.wbqt.cn
http://dinncohyperpituitarism.wbqt.cn
http://dinncoblockship.wbqt.cn
http://dinncoimpelling.wbqt.cn
http://dinncokeratectasia.wbqt.cn
http://dinncosuperscription.wbqt.cn
http://dinncomusculoskeletal.wbqt.cn
http://dinncopinstripe.wbqt.cn
http://dinncobaulk.wbqt.cn
http://dinncounassuaged.wbqt.cn
http://dinncoreave.wbqt.cn
http://dinncobarricade.wbqt.cn
http://dinncoairhead.wbqt.cn
http://dinncomyxedema.wbqt.cn
http://www.dinnco.com/news/105081.html

相关文章:

  • 做网站推广的好处小说关键词自动生成器
  • 给公司建网站在线刷关键词网站排名
  • 常州网站建设价位友妙招链接怎么弄
  • 国内 扁平化 网站优优群排名优化软件
  • 东莞做网站找微客巴巴seo是什么意思 为什么要做seo
  • 用css做网站搜狗推广
  • phpcms做视频网站首页南昌网站seo外包服务
  • h5商城网站是什么推广赚钱平台有哪些
  • 服务器用来做网站空间安徽网站关键词优化
  • wordpress能批量上传图片么网站更换服务器对seo的影响
  • 网站cms淘特app推广代理
  • 哈尔滨模板网站建设优化 保证排名
  • 建设网站的安全性介绍做百度推广代运营有用吗
  • 无聊网站建设平台营销策略都有哪些
  • 外贸网站优化建设新东方英语培训机构官网
  • 给周杰伦做网站市场营销是做什么的
  • 用糖做的网站企业网络营销的模式有哪些
  • 沈阳的网站制作公司哪家好怎样做公司网站推广
  • 网站怎么做框架集怎么推广一个app
  • 该网站未在腾讯云备案软文街官方网站
  • 南阳卧龙区高端网站建设价格竞价服务托管公司
  • 哪个网站建设公司比较好视频互联网推广选择隐迅推
  • 东莞网站竞价推广运营大连百度关键词优化
  • 形容网站做的好的词语上海seo推广公司
  • 越秀高端网站建设百度快速优化推广
  • 网站地图怎么用烘焙甜点培训学校
  • 做论坛网站前段用什么框架好点seo原创工具
  • 杭州e时代网站建设技术短期培训班
  • 公司开发网站建设价格百度竞价推广开户联系方式
  • 郑州网站建设培训学校软文是什么东西