1116 Come on! Let's C (20 point(s))

一、qt下载与安装 qt与qtcreator 的区别与联系 1、QT Creator只是一个集成的编译器,用于将源代码编译成可执行程序。 QT 是跨平台C++图形用户界面应用程序开发框架,可以简单理解成是一个开发包。 2、Qt是完全面向对象的,很容易扩展,并且允许真正地组件编程。 QT Creator 跨平台的 Qt IDE,Qt Creator 是 Qt 被 Nokia 收购后推出的一款新的轻量级集 ... 阅读详情

1116 Come on! Let's C (20 point(s))

"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun, the award rules are funny as the following:

  • 0、 The Champion will receive a "Mystery Award" (such as a BIG collection of students' research papers...).
  • 1、 Those who ranked as a prime number will receive the best award -- the Minions (小黄人)!
  • 2、 Everyone else will receive chocolates.

Given the final ranklist and a sequence of contestant ID's, you are supposed to tell the corresponding awards.

Input Specification:

Each input file contains one test case. For each case, the first line gives a positive integer N (≤10​4​​), the total number of contestants. Then N lines of the ranklist follow, each in order gives a contestant's ID (a 4-digit number). After the ranklist, there is a positive integer K followed by K query ID's.

Output Specification:

For each query, print in a line ID: award where the award is Mystery Award, or Minion, or Chocolate. If the ID is not in the ranklist, print Are you kidding? instead. If the ID has been checked before, print ID: Checked.

Sample Input:

6
1111
6666
8888
1234
5555
0001
6
8888
0001
1111
2222
8888
2222

Sample Output:

8888: Minion
0001: Chocolate
1111: Mystery Award
2222: Are you kidding?
8888: Checked
2222: Are you kidding?

简单题。

如果没有出现过的ID再次查询不输出Checked,题目没有说明,但可以从样例中看出来。

#include<stdio.h>
const int MAX = 1e4+7;
bool isChecked[MAX]={false};
int rank[MAX]={0};
bool isPrime(int n){
	for(int i=2;i*i<=n;i++){
		if(n%i==0) return false;
	}
	return true;
}
int main(void){
	int n,a;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a);
		rank[a]=i;
	}
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a);
		printf("%04d: ",a);
		if(rank[a]==0) printf("Are you kidding?\n");
		else if(isChecked[a]) printf("Checked\n");
		else{
			if(rank[a]==1) printf("Mystery Award\n");
			else if(isPrime(rank[a])) printf("Minion\n");
			else printf("Chocolate\n");
		}
		isChecked[a]=true;
	}
	return 0;
} 

 

SAP采购含税价转换的底层逻辑解析:ABAP例程如何实现价税分离计算 本文深入解析SAP系统中采购含税价与不含税价的转换机制,重点介绍VOFM例程和ABAP代码实现价税分离计算的方法。通过详细讲解数学原理、税率体系及SAP定价引擎架构,为开发人员提供完整的解决方案,帮助提升采购业务中的价格处理效率和准确性。 阅读详情

相关推荐

monocle3-单细胞轨迹分析在疾病研究中的应用

本文深入探讨了monocle3在单细胞轨迹分析中的核心应用,特别是在疾病研究领域。通过实战案例,详细讲解了如何利用monocle3进行轨迹推断,构建细胞状态演变的“路线图”,并结合伪时间分析定位疾病进展阶段。文章还介绍了如何挖掘驱动疾病发展的关键基因,并分享了数据整合、根节点选择等进阶技巧与避坑指南,旨在帮助研究者利用这一强大工具揭示肿瘤异质性、免疫治疗耐药等复杂生物学过程的动态机制。

a3b4c5的博客 639

PAT 甲级 1116 Come on! Let's C (20 分)

思路: 1.用两个大数组分别存储每个参赛者的rank,存储参赛者信息是否已被查阅; 2.先判断参赛者的rank是不是0,如果是0则未参赛; 3.其次查阅参赛者信息是否已被查阅; 4.再判断他的rank是不是1; 5.然后判断rank是不是素数; 6.剩下的都拿巧克力; 7.查阅后记得更新查阅数组; 代码: #include<iostream> #include<cmath>...

Yuhan的博客 309

海康威视SADP SDK实战:5分钟搞定局域网设备搜索(附C++代码示例)

本文详细解析了海康威视SADP SDK在局域网设备搜索中的高效应用,通过C++代码示例展示如何快速实现设备发现与信息获取。SADP协议支持全面设备信息采集和实时状态更新,适用于智能安防和物联网管理场景,帮助开发者5分钟内完成设备搜索功能集成。

rum55的博客 877

PAT (Advanced Level) Practice 1116 Come on! Let's C

1116 Come on! Let's C(20 分) "Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun,...

花とアリス殺人事件 361

机器学习模型系列:随机森林的原理和示例介绍

让我们总结一下与其他监督式机器学习模型相比,随机森林的优缺点。优点在许多真实数据集上已知能提供高度准确的模型。通过结合多个决策树的预测,可以捕捉数据集中的复杂交互和模式。通过自动选择相关特征,可以有效处理高维数据集。与单个决策树相比,不容易过拟合。自助采样和每个节点的随机特征选择有助于减少过拟合并改善泛化能力。可以处理包括数值和分类特征在内的异构数据类型。可以处理缺失值而不需要填充。提供特征重要性的度量。集成中的树可以并行训练,因为每个决策树可以独立构建。模型的泛化误差具有理论上的界限。

数智笔记 1万+

C#实战:基于ONNX与SCRFD/ArcFace的高效人脸识别系统开发

本文详细介绍了如何在C#环境中,利用ONNX Runtime高效部署SCRFD人脸检测与ArcFace人脸识别模型,构建一个完整的、高性能的人脸识别系统。内容涵盖环境搭建、模型推理、人脸对齐、特征提取等核心模块,并提供了从Demo到生产系统的优化思路与实战代码,为.NET开发者提供了一套开箱即用的解决方案。

weixin_29061821的博客 488

1116 Come on! Let‘s C(20分)

给定排名列表,第一名输出“Mystery Award”,素数排名输出“Minion”,其余输出“Chocolate”,然后给定查询列表,如果之前已经被查询过,就输出“Checked”,没有在列表中则输出“Are you kidding?

a131529的博客 244

Vue项目实战:用DataV的dv-scroll-board打造高颜值滚动表格(附完整代码)

本文详细介绍了如何在Vue项目中使用DataV的dv-scroll-board组件打造高颜值滚动表格。从基础集成到高级配置,包括动态数据处理、深度样式定制、性能优化策略以及交互增强方案,帮助开发者快速实现企业级数据展示需求。特别针对样式优化和滚动表格的常见问题提供了实用解决方案。

weixin_30892037的博客 499

PTA甲级 1116 Come on! Let‘s C (C++)

“Let’s C” is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun, the award rules are funny as the following: 0、 The Champion will receive a “Mystery

Misdirection 217

llama2-7b下载并转llama-2-7b-hf

④输入https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/convert_llama_weights_to_hf.py会下载 convert_llama_weights_to_hf.py 文件,我们需要用到这个文件将llama2-7b转成llama-2-7b-hf。③下载完之后是这四个文件,这里我是在windows操作系统中安装的WSL,没有linux操作系统,没办法。

wenling54321的博客 1031

22、预条件技术:矩阵分解与多项式预条件器

本文系统介绍了预条件技术中的不完全分裂法、多项式预条件器和近似逆预条件器。内容涵盖矩阵分解的基本原理、不完全LU和Cholesky分解的实现方法、基于填充水平和阈值策略的改进技术,以及多项式和近似逆预条件器的数学基础与应用。通过算法流程图和表格对比,展示了各类预条件器的适用场景与优缺点,同时探讨了其在迭代求解中的关键作用和未来发展方向。

theta的博客 96

PAT 甲级 1116 Come on! Let's C

题意:按照顺序给列表中的获奖名单设置等级,冠军将会得到一份神秘的礼物,而排名是质数的将会得到一个小黄人,其余获奖者将会得到巧克力。 思路:用一个book数组保存每个人的等级,等级从1开始,第一个是冠军,用check数组保存该同学是否已经奖励过了,输入完数据后,来一个判断一个,先判断是否存在于获奖名单中,在判断其是否已经被奖励过了,然后根据排名来奖赏相应的礼物。注意所进行操作都是针对其排名而言的。...

qq_42152681的博客 203

在虚拟机中对阿克曼转向车进行导航及避障的仿真测试

一、    在我使用rosdep install teb_local_planner去安装teb_local_planner的时候,报错:Command ‘rosdep’ not found, but can be installed with:sudo apt install python3-rosdep2    我花大半个月好不容易建立起的一系列ROS环境,被python3-rosdep2这条万恶的语句连同ROS一起给我删了。。。悲伤来的那么猝不及防    随着ROS版本的迭代,相关资料很多都不再适用

慕羽★的博客 3810

1116 Come on! Let's C (20 point(s))

#include&lt;iostream&gt; #include&lt;map&gt; #include&lt;cstdio&gt; #include&lt;cmath&gt; using namespace std; const int MAXN = 1e5; int ran[MAXN]; map&lt;int, bool&gt; have; int n, k, x; bool ispr...

徐伯莱 234

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

【PAT】A1116 Come on! Let's C (20point(s))

文章目录A1116 Come on! Let's C (20point(s))Input Specification:Output Specification:Sample Input:Sample Output:CodeAnalysis Author: CHEN, Yue Organization: 浙江大学 Time Limit: 200 ms Memory Limit: 64 MB Code...

Duke 195

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

PAT_甲级_1116 Come on! Let's C (20point(s)) (C++)【签到题】

目录 1,题目描述 题目大意 2,思路 3,AC代码 4,解题过程 1,题目描述 BIG collection of students' research papers:学生研究论文大集; Sample Input: 6 1111 6666 8888 1234 5555 0001 6 8888 0001 1111 2222 8888 2222 Sample Out...

&再见萤火虫&的博客 319

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

1116 Come on! Let's C (20 分)

1116Come on! Let's C(20分) "Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of ...

weixin_30828379的博客 147

1116 Come on! Let's C (20 分)

"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun, the award rules are funny as...

_Gray 167

A1116 Come on! Let‘s C (20) 逻辑题

#include<cstdio> #include<iostream> #include<cmath> using namespace std; const int maxn=100001; bool vis[maxn]={false},is[maxn]={false}; int a[maxn],Id[maxn]; bool isprime(int x) { for(int i=2;i<=sqrt(x);i++) { if(x%i==0)

coder_Kim的博客 258

pat甲1116. Come on! Let's C(模拟)

pat甲1116. Come on! Let's C(模拟)"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun, the award rules are funny as the following: 0. The Ch

ninesun的博客 305

1116 Come on! Let's C(20 分)

"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun, the award rules are funny as...

ysq96的博客 314

PAT甲级1116 Come on! Let‘s C:[C++题解]哈希表、素数

刷题

阿正的梦工坊 501

1116. Come on! Let's C

1116. Come on! Let's C (20) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue "Let's C" is a popular and fun programmin

sky247391475的博客 1203

1116 Come on! Let‘s C (20 分)测试点3错误(已改),没有判断是否是素数

太坎坷了,题读错了 1⃣️1、prime表示是质数,不是1,首要的(第一)才能拿小黄鸭 2⃣️并不会因为ranklist中的id不存在而让后边的排序上升,想复杂了,因此下边的代码没必要 for(int i=0;i<n2;i++) { cin>>idlist[i]; isexist[idlist[i]]=1; } for(int i=0;i<n1;i++){ rankhash[ranklist[i]]=su

qq_42835526的博客 218

PAT甲1116 Come on! Let's C(20 分)

#include &lt;string.h&gt; #include &lt;stdio.h&gt; #include &lt;vector&gt; #include &lt;queue&gt; #include &lt;algorithm&gt; #include &lt;map&gt; #include &lt;string&gt; #include &lt;iostream&

一点点 290

A1116. Come on! Let’s C (20| 简单逻辑题,附详细注释,逻辑分析)

写在前面 实现思路 质数 / 素数判断函数 字符串容器数组封装打印结果集 读入初始输入并标记奖励award类型 格式控制打印输出, 已查询过的ID,迭代更新状态 题目简单,15分钟a题 测试用例 input: 6 1111 6666 8888 1234 5555 0001 6 8888 0001 1111 2222 8888 2222 output: 8888: Minion 00...

kngines 416
上一篇: 1020 Tree Traversals (25 point(s))
下一篇: 1094 The Largest Generation (25 point(s))
coderwait
博客等级 码龄9年 20粉丝 210原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值