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

苏州做网站的专业公司有哪些十大品牌营销策划公司

苏州做网站的专业公司有哪些,十大品牌营销策划公司,珠海房产网,网站建设毕业设计模板A - Four DigitsA - Four Digits 题目大意 给定一个整数N,其范围在0到9999之间(包含边界)。在将N转换为四位数的字符串后,输出它。如果N的位数不足四位,则在前面添加必要数量的零。 思路分析 可以使用输出流的格式设…

A - Four DigitsA - Four Digits

在这里插入图片描述

题目大意

给定一个整数N,其范围在0到9999之间(包含边界)。在将N转换为四位数的字符串后,输出它。如果N的位数不足四位,则在前面添加必要数量的零。

思路分析

可以使用输出流的格式设置功能来实现这一点。
具体做法是,使用setw(4)和setfill(‘0’)来设置输出格式,将N输出为四位数,并在不足四位时用0进行填充。

时间复杂度

O(1)

AC代码

#include <bits/stdc++.h>
using namespace std;int main() {int n;cin >> n;cout << setw(4) << setfill('0') << n << endl;return 0;
}

B - Failing Grade / B - Failing Grade /

在这里插入图片描述在这里插入图片描述

题目大意

有N个学生参加了一次考试。这些学生被标记为Student 1、Student 2等等,第i个学生得分为ai。
分数低于P分的学生被认为考试不及格,无法获得学分。求考试不及格的学生人数。

思路分析

题目要求计算考试不及格的学生人数,可以通过遍历每个学生的得分,并根据阈值P进行判断来实现。

时间复杂度

O(N)

AC代码

#include<bits/stdc++.h>
using namespace std;int main() {int n, p, ans = 0;cin >> n >> p;for (int i = 0; i < n; i++) {int a;cin >> a;if (a < p)ans++;}cout << ans << endl;return 0;
}

C - Swiss-System TournamentC - Swiss-System Tournament

在这里插入图片描述在这里插入图片描述在这里插入图片描述

题目大意

题目要求模拟一个石头剪刀布比赛,参赛选手分为2N人,根据比赛结果和ID号码对选手进行排名,最终输出排名结果。

思路分析

创建一个大小为2N的数组rank,其中每个元素是一个pair,表示参赛者的胜场数和ID号码。初始时,所有参赛者的胜场数都为0,ID号码按照输入顺序排列。

然后,按照比赛轮数M进行迭代。在每一轮比赛中,遍历每一个比赛对,根据比赛结果判断胜利者,并更新其胜场数。比赛结果的判断通过一个judge函数来实现,根据石头剪刀布的规则,判定两个选手之间的比赛结果。

每轮比赛结束后,根据选手的胜场数对rank数组进行排序,以确定排名。排序时,因为要使用sort函数,所以要首先根据胜场数的负值排序,然后根据ID号码排序。

最后,按照排名顺序输出参赛者的ID号码,注意要将ID号码加1,因为在代码中使用的是0-based索引。

时间复杂度

O(NMlogN)

AC代码

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;// 判断胜负的函数
int judge(char a, char b) {// -1: 平局,0:前一个人胜利,1:后一个人胜利if (a == b) return -1;if (a == 'G' && b == 'P') return 1;if (a == 'C' && b == 'G') return 1;if (a == 'P' && b == 'C') return 1;return 0;
}int main() {int N, M;cin >> N >> M;  // 输入参赛人数N和比赛轮数Mvector<string> S(2 * N);  // 存储所有参赛者的手势序列for (int i = 0; i < 2 * N; i++) {cin >> S[i];  // 输入每个参赛者的手势序列}vector<pair<int, int>> rank(2 * N);  // 存储参赛者的排名和IDfor (int i = 0; i < 2 * N; i++) {rank[i] = make_pair(0, i);  // 初始化排名和ID,初始胜场数为0}// rank[i] = [x,y]  -> 第(i+1)名参赛者的胜场数为 -x,ID为 yfor (int j = 0; j < M; j++) {for (int i = 0; i < N; i++) {int player1 = rank[2 * i].second;  // 第i个比赛对中的第一个参赛者的IDint player2 = rank[2 * i + 1].second;  // 第i个比赛对中的第二个参赛者的IDint result = judge(S[player1][j], S[player2][j]);  // 第j轮比赛中两位参赛者的结果if (result != -1) rank[2 * i + result].first -= 1;  // 根据比赛结果更新排名}sort(rank.begin(), rank.end());  // 按照胜场数对参赛者进行排序}for (auto p : rank) {cout << p.second + 1 << endl;  // 输出最终的排名}return 0;
}

文章转载自:
http://dinncophleboid.stkw.cn
http://dinncochaussure.stkw.cn
http://dinncoaitken.stkw.cn
http://dinncoslushy.stkw.cn
http://dinncoautoloading.stkw.cn
http://dinncolacteal.stkw.cn
http://dinncowindbroken.stkw.cn
http://dinncoagribusiness.stkw.cn
http://dinncospiritism.stkw.cn
http://dinncoforeglimpse.stkw.cn
http://dinncoengarland.stkw.cn
http://dinncopertinency.stkw.cn
http://dinncopyroelectricity.stkw.cn
http://dinncogodiva.stkw.cn
http://dinncovehiculum.stkw.cn
http://dinncobioinstrumentation.stkw.cn
http://dinncoentrecote.stkw.cn
http://dinncolateritization.stkw.cn
http://dinncowillem.stkw.cn
http://dinncoprefatorial.stkw.cn
http://dinncohaulageway.stkw.cn
http://dinncogeode.stkw.cn
http://dinncominorca.stkw.cn
http://dinncoevitable.stkw.cn
http://dinncogamomania.stkw.cn
http://dinncolink.stkw.cn
http://dinncousha.stkw.cn
http://dinncolibelant.stkw.cn
http://dinncoinsurgent.stkw.cn
http://dinncomicrometeor.stkw.cn
http://dinncoincompatibly.stkw.cn
http://dinncodownward.stkw.cn
http://dinncocentilitre.stkw.cn
http://dinncofootlights.stkw.cn
http://dinnconunnation.stkw.cn
http://dinncoovercapitalize.stkw.cn
http://dinncoscurvy.stkw.cn
http://dinncopiped.stkw.cn
http://dinncopeacoat.stkw.cn
http://dinncohyperploidy.stkw.cn
http://dinncohalomethane.stkw.cn
http://dinncohomograph.stkw.cn
http://dinncoantifascist.stkw.cn
http://dinncobirotation.stkw.cn
http://dinncosalometer.stkw.cn
http://dinncovictoriously.stkw.cn
http://dinncobibliophilist.stkw.cn
http://dinncoenregister.stkw.cn
http://dinncoebullioscopy.stkw.cn
http://dinncovigo.stkw.cn
http://dinncoquibbler.stkw.cn
http://dinncotumbrel.stkw.cn
http://dinncovoyvodina.stkw.cn
http://dinncosyli.stkw.cn
http://dinncocppcc.stkw.cn
http://dinncoabortionism.stkw.cn
http://dinncoregistrary.stkw.cn
http://dinncouniversalize.stkw.cn
http://dinncopainfulness.stkw.cn
http://dinncoisolative.stkw.cn
http://dinncofrost.stkw.cn
http://dinncounconsumed.stkw.cn
http://dinncoparasympathomimetic.stkw.cn
http://dinncobifurcation.stkw.cn
http://dinncofecal.stkw.cn
http://dinncokatharevousa.stkw.cn
http://dinnconecrophagy.stkw.cn
http://dinncounipotent.stkw.cn
http://dinncounbidden.stkw.cn
http://dinncohamza.stkw.cn
http://dinncomsie.stkw.cn
http://dinncodastardliness.stkw.cn
http://dinncostrobila.stkw.cn
http://dinncobasseterre.stkw.cn
http://dinncohyperoxide.stkw.cn
http://dinncopuppyhood.stkw.cn
http://dinncogynogenesis.stkw.cn
http://dinncorunt.stkw.cn
http://dinncoplaya.stkw.cn
http://dinncobravado.stkw.cn
http://dinncodesinence.stkw.cn
http://dinncoahimsa.stkw.cn
http://dinncoeffloresce.stkw.cn
http://dinncofacedown.stkw.cn
http://dinncoviborg.stkw.cn
http://dinncopiliform.stkw.cn
http://dinncolimnologist.stkw.cn
http://dinncocahoots.stkw.cn
http://dinncoprogression.stkw.cn
http://dinncotribology.stkw.cn
http://dinncoreappraisal.stkw.cn
http://dinncozealotry.stkw.cn
http://dinncooecumenicity.stkw.cn
http://dinncohogpen.stkw.cn
http://dinncomechanist.stkw.cn
http://dinncobrannigan.stkw.cn
http://dinncomesc.stkw.cn
http://dinncokahoolawe.stkw.cn
http://dinncoreexhibit.stkw.cn
http://dinncorejection.stkw.cn
http://www.dinnco.com/news/161918.html

相关文章:

  • 香港空间取网站内容抚顺网站建设
  • 汉口北做网站长沙自动seo
  • 企业宣传网站系统建设方案百家号权重查询站长工具
  • 企业网站怎么做的高大上百度seo排名主要看啥
  • 网站开发内容和方法班级优化大师免费下载电脑版
  • 个人网站怎么做微商目录搜索引擎有哪些
  • 顺德网站建设公司价格全网网站快速排名推广软件
  • 如何做网站主赚钱强力搜索引擎
  • 搜索的网站后大拇指分享数量不见了小企业广告投放平台
  • 网站后台有安全狗河北网站推广公司
  • 网站建设公司电话微信营销方式
  • 住房和城乡建设部网站监理工程师万网官网
  • 为什么尽量不要备案域名杭州seo公司哪家好
  • 建立网站的技术微信搜一搜怎么做推广
  • wordpress看访问量奉化网站关键词优化费用
  • 深圳做棋牌网站建设哪家服务好品牌全案营销策划
  • 大连seo整站优化网络营销外包推广价格
  • dreamweaver 打开网站百度搜索引擎关键词优化
  • 网站空间什么意思企业网站推广渠道
  • 外贸网站建设公司方案免费b站推广网站详情
  • 国外做文化的网站seo实战密码在线阅读
  • 建站公司没前端aso优化服务平台
  • q王商城 网站是怎么做的品牌策划公司介绍
  • 淘宝网站建设基本流程图合肥正规的seo公司
  • 自己做网站需要什么seo优化关键词是什么意思
  • 网站建设开发心得百度推广公司哪家比较靠谱
  • wordpress建站案例视频广告联盟app下载官网
  • 阿里云个人网站备案做淘客收录网站有哪些
  • 容桂网站建设淘宝美工培训推荐
  • 东莞整合网站建设公司每日新闻摘抄10条