Codeforces Round #442 (Div. 2) A Alex and broken contest

大一零基础参加电子设计竞赛:从单片机到PID的完整备赛与实战指南 在工程实践中,单片机是嵌入式系统最基础的入门核心,无论是51系列还是STM32,都承载着从硬件控制到算法落地的关键桥梁作用。理解单片机的工作原理、外设接口与中断机制,是构建智能控制系统的第一步。传感器负责感知物理世界,电机驱动实现执行动作,而PID算法则让系统具备精确调节与稳定运行的能力,这三者的协同构成了典型的闭环控制系统,广泛应用于智能小车、自动化设备等领域。全国大学生电子设计竞赛正是这些底层技术的综合演练场,其题目往往围绕循迹、避障、速度控制等真实场景展开,要求参赛者在短时间内完成方案设计、电路搭建与 阅读详情
A. Alex and broken contest
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems.

But there are too many problems, to do it manually. Alex asks you to write a program, which will determine if a problem is from this contest by its name.

It is known, that problem is from this contest if and only if its name contains one of Alex's friends' name exactly once. His friends' names are "Danil", "Olya", "Slava", "Ann" and "Nikita".

Names are case sensitive.

Input

The only line contains string from lowercase and uppercase letters and "_" symbols of length, not more than 100 — the name of the problem.

Output

Print "YES", if problem is from this contest, and "NO" otherwise.

Examples
input
Alex_and_broken_contest
output
NO
input
NikitaAndString
output
YES
input
Danil_and_Olya
output
NO


题意 给出四个字符串 求输入的字符串s中 如果有且只有一个字符串包含在s中 那么就输出Yes 反之输出No

用很蠢的方法判断一下

#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
	char str[150];
	int D = 0, O = 0, S = 0, A = 0, N = 0;
	scanf("%s", str);
	int l = strlen(str);
	str[l] = str[l + 1] = str[l + 2] = str[l + 3] = str[l + 4] = '0';
	for (int i = 0; i < l; i ++) {
		if (str[i] == 'A' && str[i + 1] == 'n' && str[i + 2] == 'n') {
			A ++;
		}
		if (str[i] == 'O' && str[i + 1] == 'l' && str[i + 2] == 'y' && str[i + 3] == 'a') {
			O ++;
		}
		if (str[i] == 'D' && str[i + 1] == 'a' && str[i + 2] == 'n' && str[i + 3] == 'i' && str[i + 4] == 'l') {
			D ++;
		}
		if (str[i] == 'S' && str[i + 1] == 'l' && str[i + 2] == 'a' && str[i + 3] == 'v' && str[i + 4] == 'a') {
			S ++;
		}
		if (str[i] == 'N' && str[i + 1] == 'i' && str[i + 2] == 'k' && str[i + 3] == 'i' && str[i + 4] == 't' && str[i + 5] == 'a') {
			N ++;
		}
	}
	if (A + O + D + S + N == 1) {
		printf("Yes\n");
	}
	else {
		printf("No\n");
	}
	
}


微信小程序URL Link全解析:从生成原理到实战应用(附Java代码) 本文深入解析微信小程序URL Link的生成原理与实战应用。URL Link是微信官方提供的智能路由协议,通过中间页实现外部链接安全跳转至小程序指定页面。文章详细阐述了其权限模型、环境版本差异及跳转机制,并提供了包含令牌管理、异常处理和性能优化的健壮Java实现方案,助力开发者构建高可用的链接生成服务。 阅读详情

相关推荐

双目立体成像(一)双目图片生成点云

利用左右目图片生成点云

qq_62964142的博客 4550

CodeForces - 877A 朴素字符串匹配

Alex and broken contestOne day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems.B

? 590

从封装到先进封装:一文讲透Chiplet、2.5D/3D堆叠与系统集成

封装是芯片产业链中连接硅片与电路板的桥梁,承担物理保护、电气连接、散热与机械支撑等核心任务。传统封装从DIP、QFP发展到BGA,通过提升引脚密度满足早期性能需求。随着摩尔定律放缓,单纯缩小晶体管尺寸难以为继,先进封装应运而生,其核心理念从“封装单颗芯片”转向“系统级高密度集成”。扇出型封装、2.5D硅中介层、3D堆叠、Chiplet和系统级封装等技术,通过微米级互连和垂直堆叠,大幅提升I/O密度与带宽,成为AI芯片、HBM存储、高性能计算等领域的关键支撑。本文梳理先进封装的技术演进、分层架构与工程难点,帮

weixin_29185167的博客 365

codeforces 442 A. Alex and broken contest(水题)

outputstandard output One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems. But there are too many problems, to do it manually. Ale

风的记忆 782

从零开始掌握RDMA拥塞控制:原理、算法与实战解析

本文深入解析了RDMA拥塞控制的核心原理与实战配置。RDMA依赖无损网络保障高性能,其关键在于PFC与ECN两大技术协同防止丢包。文章重点剖析了主流算法DCQCN的工作机制与参数调优,并简要介绍了HPCC与TIMELY等前沿算法。最后提供了在Linux上配置RoCEv2与DCQCN的详细步骤及性能调试方法,帮助读者从零构建稳定的RDMA网络环境。

weixin_28452161的博客 135

VSCode关联VIVADO编辑Verilog

有时候接手别人的代码,或者从网上找的开源代码,每个人风格不一致,对齐缩进也不一样,阅读起来很累。有没有什么方法能快捷地格式化代码呢。下面我们利用VSCode插件来实现这个需求。Vivado是Xilinx公司提供的逻辑开发平台(之一),如果不喜欢Vivado自带的文本编辑器,可以选择第三方的文本编辑器VSCode。

小王在努力...的博客 7150

A. Alex and broken contest

One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems.But there are too many p

wtml 381

【专栏目录】

🌟 深度学习工程师的终极武器库!本专栏深度解析近3年CV领域最前沿的YoloV8改进方案,每一种方法都经过实战验证,性能显著提升!🌟。

m0_47867638的博客 1万+

Codeforces Round #442 A Alex and broken contest

Ciwikun有5个朋友,他们的名字分别是"Danil", "Olya", "Slava", "Ann"和"Nikita".这个问题很简单: 给你一个字符串, 问: 字符串中是否只包含Ciwikun的一个朋友的名字,并且这个名字仅出现一次 他们的名字区分大小写Input 这个字符串只包含小写字母,大写字母和"_"(下划线), 字符串的长度不超过100Output 如果Ciwikun的朋

YIU 318

第201期 解锁科研效率新高度:Claude 科学技能插件(claude-scientific-skills)深度体验

科研AI助手Claude Scientific Skills开源工具为Claude大模型扩展科学能力,覆盖数据可视化、数学计算、学术格式处理等科研全流程需求。该插件支持LaTeX公式生成、自动化科研图表绘制、学术文档规范校正等功能,让研究人员通过自然语言指令即可完成专业任务。项目开源可定制,支持特定学科需求扩展,目前已托管于GitHub。使用门槛低,只需配置Claude API密钥即可快速启用,帮助科研人员从繁琐技术细节中解放,聚焦核心研究创新。

全网120W+关注AI拉呱,专注人工智能以及科技前沿! 1357

基于Xilinx K7-410T的高速DAC之AD9129开发笔记(一)

引言:从本文开始,我们介绍下项目中设计的并行LVDS高速DAC接口设计,包括DAC与FPGA硬件接口设计、软件设计等。项目设计高速DAC采用了ADI公司的AD9129,该芯片最大更新速率5.7Gsps,该芯片在宽带通信应用、LTE、雷达信号产生、干扰机等领域有广泛应用。

FPGA_Designer 2533

Codeforces Round #442 (Div. 2) A. Alex and broken contest

给出了五个朋友的名字,当且仅当其名称中包含Alex的一个朋友的名字一次时,输出YES否则输出NO

AC__GO的博客 779

一步到位解决Docker拉取镜像失败的问题!超详细的Docker代理设置教程!(使用代理解决群晖Docker获取注册表失败的问题)

一步到位解决Docker拉取镜像失败的问题!超详细的Docker代理设置教程!(使用代理解决群晖Docker获取注册表失败的问题)

XiaoqiangClub的博客 1万+

【Codeforces Round #442 (Div. 2) A】Alex and broken contest

【链接】 我是链接,点我呀:) 【题意】 在这里输入题意 【题解】 注意是所有的名字里面,只出现了其中某一个名字一次。 【代码】 #include <bits/stdc++.h> using namespace std; const string temp[] = {"Danil","Olya","Slava","Ann","Nikita"}; st...

AWCXV 154

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

Codeforces Round #442 (Div. 2) A. Alex and broken contest

A. Alex and broken contestProblem Statement     One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find

Ephemeral 438

廖雪峰Python教程[完整版]

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

Codeforces Round #442 (Div. 2) A. Alex and broken contest,B - Nikita and string

A. Alex and broken contest time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output One day Alex was creating a contest about his friends, but acci

NITjianbagengmu的博客 449

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

Alex and broken contest Codeforces Round #442

本来按计划昨天是要更新博客的。。不过这两天实在很忙,要准备电路的考试,而且昨天巨忙。。。 这是昨天写的一道题,很简单,题目容易理解直接调用C++里面的string的find函数就能处理的很好 不过以前学的那些STL知识。。。不用就忘了很多。 这道题里面的find函数里面传入了两个参数,就是说从s的下标index开始进行查询string字符串,并且返回出现的首地址,不过返回类型要用size_t

qq_37020000的博客 255

Codeforces Round #442 A Alex and broken contest【字符串/常量数组/string类】

A. Alex and broken contest time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One day Alex was creating a contest abou...

weixin_30551947的博客 114

Codeforces 877 A Alex and broken contest

题目地址 题意:告诉你一个字符串,问你这个字符串中出现了多少次他5个朋友的名字(”Danil”, “Olya”, “Slava”, “Ann”, “Nikita”),如果就出现一次就输出“YES”,否则为“NO”。 思路:直接按条件暴力搜就好了。

不要錯過才珍惜 680

CodeForces 877A Alex and broken contest

One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems. But there are too man...

codertcm的博客 339

CodeForces 877A Alex and broken contest KMP入门

A. Alex and broken contesttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Alex was creating a contest about his friends, but accidentally ...

popcjz的博客 359

Alex and broken contest (字符串)CodeForces - 877A

第五次个人赛 One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems. But there are...

Allen的博客 375

A - Alex and broken contest

A - Alex and broken contest One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other prob...

weixin_43846755的博客 349

比赛题解 (1)—— 思维

1——————————CodeForces 877A One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other prob...

JKdd123456的博客 561
上一篇: 2017南工软件ACM选拔2 题解
下一篇: Codeforces Round #442 (Div. 2) B - Nikita and string
Star77777
博客等级 码龄10年 104粉丝 95原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值