Codeforces #467 (Div. 2) A. Olympiad

STM32+RS485实现DMX512发送:协议时序、代码实现与调试避坑 DMX512是舞台灯光、景观亮化等领域广泛应用的灯光控制协议,其本质是基于串口通信的标准化帧结构。RS485作为物理层接口,通过差分信号传输实现远距离、抗干扰的总线通信,配合STM32丰富的串口资源、精确的定时器和DMA传输,可以高效完成DMX512数据的连续发送。理解协议中的Break、MAB、起始码和通道数据时序,以及RS485芯片选型、终端电阻、总线拓扑等电气细节,是稳定实现灯光控制的关键。从协议基础到STM32的UART配置、GPIO模拟Break、DMA发送等工程实践,文章梳理了常见调试方法与避坑 阅读详情

A. Olympiad

题目描述

The recent All-Berland Olympiad in Informatics featured n participants with each scoring a certain amount of points.

As the head of the programming committee, you are to determine the set of participants to be awarded with diplomas with respect to the following criteria:

At least one participant should get a diploma.
None of those with score equal to zero should get awarded.
When someone is awarded, all participants with score not less than his score should also be awarded.
Determine the number of ways to choose a subset of participants that will receive the diplomas.

输入

The first line contains a single integer n (1 ≤ n ≤ 100) — the number of participants.

The next line contains a sequence of n integers a1, a2, …, an (0 ≤ ai ≤ 600) — participants’ scores.

It’s guaranteed that at least one participant has non-zero score.

输出

Print a single integer — the desired number of ways.

样例

inputCopy
4
1 3 3 2
output
3
inputCopy
3
1 1 1
output
1
inputCopy
4
42 0 0 42
output
1

题意

就是求不重复的数字除了0有几个
set搞一下

AC代码

#include <bits/stdc++.h>
using namespace std;

#define CLR(a,b) memset(a,(b),sizeof(a))
#define LL long long

const int MAXN = 1e3+10;
const double eps = 1e-15;

int main()
{
    int n, x;
    cin >> n ;
    set<int> s;
    for(int i = 0; i < n; i++)
        cin >> x, s.insert(x);
    int k = s.size();
//    set<int>::iterator it;
//    for(it = s.begin(); it != s.end(); it++) {
//        if(*it)
//            k++;
//    }
    if(*s.begin()==0) k -= 1;
    cout << k << endl;
return 0;
}
VSCode插件全攻略:5分钟搞定Mermaid流程图实时预览(含常见报错解决) 本文提供了一份详细的VSCode插件实战指南,帮助开发者快速配置Mermaid流程图实时预览环境。文章涵盖核心插件选择、高效工作流搭建,并重点解决了图表渲染失败、样式异常等常见报错问题,旨在提升技术文档的编写效率与可视化质量。 阅读详情

相关推荐

避坑实录:用certificate-manager重置vCenter 6.7证书时遇到的三个致命陷阱

本文详细解析了使用certificate-manager重置vCenter 6.7证书时可能遇到的三大致命陷阱,包括进度卡在85%的服务启动僵局、脚本突然退出的静默杀手以及密码错误锁死的隐藏机制。通过实战验证的解决方案和高级恢复技巧,帮助系统管理员有效避免vCenter环境瘫痪,确保证书更新过程顺利进行。

g5h6i7j的博客 926

codeforces 937A Olympiad

http://www.elijahqi.win/2018/02/26/codeforces-937a-olympiad/ The recent All-Berland Olympiad in Informatics featured n participants with each scoring a certain amount of points. As the head of the p...

Elijahqi 2911

[统计模型] 基于R的潜在剖面分析(LPA)

本文主要介绍基于R进行潜在剖面分析(Latent Profile Aanalysis, LPA)。 关于潜在类别分析LCA/潜在剖面分析LPA的概念和区别,可以参考一下这篇文章: 潜在类别分析LCA \潜在剖面分析LPA介绍https://www.jianshu.com/p/4c830094131e?utm_campaign=maleskine 但是此文对潜类别分析的阐释还比较生涩,而且没有具体的代码编写、模型优选等内容。本文旨在丰富LPA的内容,并希望和大家交流、共同进步。 1. 什么是潜类别分.

bigstar863的博客 1万+

(补题)CF 467 div2

A. Olympiadtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe recent All-Berland Olympiad in Informatics featured n participants with each scoring...

gtuif的博客 386

AI驱动全栈开发实战:基于Spec与Codex的规格驱动开发指南

1. 先搞清楚“AI重构前端全栈”到底在解决什么实际问题 最近很多人在聊“AI重构前端全栈”,听起来像是又一个营销概念。但如果你真的拆开看,它核心解决的是一个非常具体且痛苦的问题: 一个开发者,如何从零开始,系统性地、不跑偏地完成一个完整项目,并且保证代码质量和架构一致性。 传统开发流程里,产品经理出PRD,前后端开会对齐,前端画页面,后端写接口,测试再介入。这个过程沟通成本高,文档容易过时,新人上手慢。而“AI重构”的思路,是试图用一套 规范化的指令(Spec) 来驱动AI(比如Codex这类模型)生成代

weixin_30596023的博客 467

edusrc挖掘思路

edusrc挖掘思路前言思路信息搜集系统账号常见漏洞实战分享1、确定目标,语法:site:xxxx.edu.cn2、账号密码组成我们知道了,谷歌语法查找工号3、爆破登录系统4、确定功能,抓具体的url5、添加单引号,报错,是mssql6、报数据库版本,到这一步就可以交了,已经是中危了后记 前言 一月份的时候偶然注意到edusrc,起初是抱着学习的心态去挖几个洞,可是后面发现有证书,而且还贼好看,于是我动了凡心,一顿操作也拿了几本,广西民大、山东理工、同济,未到的有浙大、上海理工,证书要求证书图片可以在我个人

qq_45414878的博客 2万+

D. Olympiad(贪心 + 尺取)

A boy named Vasya has taken part in an Olympiad. His teacher knows that in total Vasya got at least x points for both tours of the Olympiad. The teacher has the results of the first and the second tou...

一身清贫怎敢入繁华 540

YOLOv8改进-bifpn

跨尺度连接通过添加一个跳跃连接和双向路径来实现,自此实现了加权融合和双向跨尺度连接。该结构是加权且双向连接的,即自顶向下和自底向上结构,通过构造双向通道实现跨尺度连接,将特征提取网络中的特征直接与自下而上路径中的相对大小特征融合,保留了更浅的语义信息,而不会丢失太多的深层语义信息。传统的特征融合时将尺度不同的特征图以相同权重进行加权,但是当输入的特征图分辨率不同时,以相同的权重进行加权对输出的特征图不平等。所以BiFPN根据不同输入特征的重要性设置不同的权重,同时反复采用这种结构来加强特征融合。

weixin_45303602的博客 8146

International Olympiad In Informatics 2009 August 8 – 15, Plovdiv, Bulgaria Contest Day 1 - POI

题目 http://www.ioi2009.org/GetResource?id=1271 分析 题目难度不高,有两点注意: 坑如样例。关于排名,题目中这样说: The final standings of the competition list the contestants in descending order of their scores....

dianyi2475的博客 331

Lumerical 教程目录,说明及个人感悟(共计138篇,持续更新中)

Lumerical---教程说明及个人感悟

u011699626的博客 1万+

工业4.0必备:C#上位机+数字孪生 生产线实时监控与智能预警系统(工业级实战)

数据割裂:PLC、传感器、工业相机的数据散落在不同系统,想看全局生产状态要切换N个软件,“数据孤岛”导致决策滞后;故障难预判:设备突发故障时,只能停机排查,平均故障响应时间超30分钟,一条生产线停工1小时损失超10万;可视化差:传统监控只有冰冷的数字和2D图表,设备运行状态、生产流程、物料流转无法直观感知,新人上手需3个月才能熟悉产线。

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 671

Codeforces 937A - Olympiad

A. Olympiad 题目链接:http://codeforces.com/problemset/problem/937/A time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The rec...

weixin_30569153的博客 207

第四章节 Qt字符串QString详解

QString 的使用方式和 C++标准库的 std::string 字符串的非常相似。

m0_65635427的博客 892

Codeforces Round #467 (Div. 2) A. Olympiad

A. OlympiadThe recent All-Berland Olympiad in Informatics featured n participants with each scoring a certain amount of points.As the head of the programming committee, you are to determine the set of...

s540239976的博客 259

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

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

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

Codeforces Round #467 (Div. 2) A. Olympiad[输入一组数,求该数列合法的子集个数]

题目链接:点击进入 只要想到这个方法就是非常简单的水题! 代码: #include&lt;bits/stdc++.h&gt; using namespace std; int a[1001]; int main(){ set&lt;int&gt;s; int n; cin&gt;&gt;n; for(int i=0;i&lt;n;i++){ c...

韧锋zzZ的Blog 269

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

Codeforces Round #467 Div.2题解

A. Olympiad time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The recent All-Berland Olympiad in Informat...

dav74739的博客 308

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Codeforces Round #467 (Div. 2)T1题解

原题链接 http://codeforces.com/contest/937/problem/A 题目大意 给定N个人,和这N个人分数,问有几种分配奖牌的方法,奖牌分配 遵循以下规则 1.至少有一个人获得奖牌 2.得到0分的人无论如何也不能得到奖牌 3.如果得分为X的人得到了奖牌,那么得分&gt;=X的人也必须获得奖牌 题面 A. Olympiad time limit per ...

WD_louchenhao的博客 332

Codeforces Round #467 (Div. 2)【A B C D】

A - Olympiad The recent All-Berland Olympiad in Informatics featured n participants with each scoring a certain amount of points. As the head of the programming committee, you are to determine ...

王小二的博客 616

Codeforces 937A

A. Olympiadtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe recent All-Berland Olympiad in Informatics featured n participants with each scoring...

qq_38182397的博客 423

Codeforces #467 (Div. 2) B. Vile Grasshoppers ( 数学

B. Vile Grasshoppers 题目描述 The weather is fine today and hence it’s high time to climb the nearby pine and enjoy the landscape. The pine’s trunk includes several branches, located one above another...

Yishui_lovely 729

Codeforces Team Olympiad(暴力)

本题要求把1,2,3尽可能的平均分配到3个容器中,保证每一个都包含1、2、3,求这样的最大组合数以及输出一种可能的组合。可以暴力枚举!时间复杂度O(n),空间复杂度也为O(n)。

晓风残月xj 1000

Olympiad (奥林匹克信息赛) Visual Judge (Set3)

文章目录题目描述输入描述输出描述输入输出样例线索提示一、解题思路二、题解源代码VJudge评判结果写在最后 题目描述 The recent All-Berland Olympiad in Informatics featured n participants with each scoring a certain amount of points. As the head of the programming committee, you are to determine the set of part.

LeungSr的博客 533

Codeforces Round #467 (Div. 2) 937ABC

第一题: A. Olympiad time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The recent All-Berland Olympiad in Informatics featured n partic...

小博客 390

Codeforces 467B Fedor and New Game(暴力)

题目链接:Codeforces 467B Fedor and New Game 题目大意:给定n,m,k,n种士兵,m个部队,兵种不同数量小于等于k的为友军。然后给出m+1行,前m行表示需要判定的部队,第m+1行Fedor的部队。(按照二进制形式给定) 解题思路:直接取亦或,然后判断1的个数是否小于等于k。 #include #include #include using n

不慌不忙、不急不躁 1816

Codeforces Round #467 (Div. 2)

A. Olympiad time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The recent All-Berland Olympiad in Informatics f

zP1nG 644

937A. Olympiad

A. Olympiad time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The recent All-Berland Olympiad in Informatics f

memory_qianxiao的博客 540
上一篇: Codeforces #467 (Div. 2) B. Vile Grasshoppers ( 数学
下一篇: 牛客练习赛6 D.世界上最可爱的珂朵莉 ( 贪心
Yishui_Blog
博客等级 码龄10年 96粉丝 524原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值