Codeforces Beta Round #36 / 36A Extra-terrestrial Intelligence(模拟)

产业园区如何高效对接企业技术需求与高校科研成果?.docx 科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。 立即下载

A. Extra-terrestrial Intelligence
time limit per test
2 seconds
memory limit per test
64 megabytes
input
input.txt
output
output.txt

Recently Vasya got interested in finding extra-terrestrial intelligence. He made a simple extra-terrestrial signals’ receiver and was keeping a record of the signals for n days in a row. Each of those n days Vasya wrote a 1 in his notebook if he had received a signal that day and a 0 if he hadn’t. Vasya thinks that he has found extra-terrestrial intelligence if there is a system in the way the signals has been received, i.e. if all the intervals between successive signals are equal. Otherwise, Vasya thinks that the signals were sent by some stupid aliens no one cares about. Help Vasya to deduce from the information given by the receiver if he has found extra-terrestrial intelligence or not.

Input

The first line contains integer n (3 ≤ n ≤ 100) — amount of days during which Vasya checked if there were any signals. The second line contains n characters 1 or 0 — the record Vasya kept each of those n days. It’s guaranteed that the given record sequence contains at least three 1s.

Output

If Vasya has found extra-terrestrial intelligence, output YES, otherwise output NO.

Sample test(s)
input
8
00111000
output
YES
input
7
1001011
output
NO
input
7
1010100
output
YES

水。


完整代码:

/*30ms,100KB*/

#include<cstdio>

int main()
{
	int n, count = 0, interval = 0;
	bool is_intelligence = true;

	freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);

	scanf("%d", &n);
	getchar();
	while (n--)
	{
		if (getchar() == '1')
			break;
	}
	while (n--)
	{
		if (getchar() == '0')
			interval++;
		else
			break;
	}
	while (n--)
	{
		if (getchar() == '0')
			count++;
		else
		{
			if (count == interval)
				count = 0;
			else
			{
				is_intelligence = false;
				break;
			}
		}
	}
	printf(is_intelligence ? "YES" : "NO");
	return 0;
}


基于555定时器的D类功放设计:从PWM原理到无反馈电路实践 D类功放(数字功放)是一种高效率的音频放大技术,其核心原理是脉冲宽度调制(PWM)。它将输入的模拟音频信号转换为一系列高速开关的脉冲,通过控制功率开关管(如MOSFET)的通断,再经低通滤波器还原放大后的音频。相比传统AB类功放,其转换效率通常超过90%,显著降低了热能损耗。这项技术在追求高能效和小型化的现代音频设备中价值凸显,广泛应用于有源音箱、汽车音响和便携式设备。本文聚焦于一种独特的实现方案:以经典的555定时器芯片为核心,构建一个无整体负反馈的D类功放。通过剖析其PWM调制器、FET电压-电流转换级 阅读详情

相关推荐

ESP32C3的I2S接口详解:以驱动PCM5102A为例,避开时序与配置的那些坑

本文深入解析ESP32C3的I2S接口驱动PCM5102A DAC的完整解决方案,涵盖时序对齐、PCB优化和寄存器级配置。通过实际案例分享时钟树分析、信号完整性设计和底层调试技巧,帮助开发者避开常见陷阱,实现高质量音频输出。重点探讨了I2S协议栈、电源滤波优化及DMA传输异常处理等关键技术要点。

weixin_30254435的博客 299

【读入】#36 A. Extra-terrestrial Intelligence

A. Extra-terrestrial Intelligence time limit per test 2 seconds memory limit per test 64 megabytes input input.txt output output.txt Recently Vasya got interested in fin

CD's Coding 854

汽车软件工程师必看:ASPICE开发流程全解析(附各阶段交付物清单)

本文全面解析了汽车行业广泛采用的ASPICE开发流程,详细介绍了从需求挖掘到系统架构设计、软件工程及测试验证各阶段的关键操作和交付物清单。针对汽车软件工程师,提供了实用的协作指南和工具推荐,帮助团队提升开发效率并降低项目风险,是掌握ASPICE标准的必备指南。

weixin_30733003的博客 645

A - Extra-terrestrial Intelligence

A - Extra-terrestrial Intelligence Crawling in process... Crawling failed Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Description input input.txt

SHUI 512

AI视频生成成本优化实战:混合架构与硬件选型

AI视频生成技术正面临效果与成本的二元博弈,其核心挑战在于高昂的推理算力消耗与黑箱服务的不确定性。从技术原理看,视频生成依赖扩散模型等深度学习架构,通过多轮迭代实现像素级合成,这导致GPU显存占用和电力消耗呈指数级增长。在工程实践中,采用混合推理架构能有效平衡成本与质量,例如云端处理关键帧配合本地渲染过渡帧,实测可降低58%支出。硬件选型方面,消费级显卡魔改与边缘计算设备为中小企业提供了可行方案,如RTX 3090显存扩容或Jetson AGX边缘部署。当前AI视频应用已渗透电商直播、新闻制作等领域,但需警

weixin_29531177的博客 295

Cesium 模拟飞机坠毁功能

Cesium 模拟飞机坠毁功能,粒子模拟

QQhelphelp的博客 1068

Extra-terrestrial Intelligence

Description input input.txt output output.txt Recently Vasya got interested in finding extra-terrestrial intelligence. He made a simple extra-terrestrial signals’ receiver and was keeping a record

Baymax 745

深入解析USBlyzer抓包工具:从设备描述符到数据交互实战

本文深入解析了USBlyzer抓包工具在USB协议分析中的应用。从设备描述符的抓取与解读,到设置地址、配置描述符的实战分析,再到数据交互阶段的抓包技巧,文章通过具体案例详细展示了如何使用USBlyzer透视USB总线通信,是排查设备驱动问题、逆向分析通信协议和学习USB规范的实用指南。

weixin_29171087的博客 741

A. Extra-terrestrial Intelligence

A. Extra-terrestrial Intelligencetime limit per test2 secondsmemory limit per test64 megabytesinputinput.txtoutputoutput.txtRecently Vasya got interested in finding extra-terrestrial intelligence. He

chaideyipi 617

【水文】calico-node 启动失败 Init:CrashLoopBackOff

Defaulted container "calico-node" out of: calico-node, upgrade-ipam (init), install-cni (init), mount-bpffs (init) Error from server (BadRequest): container "calico-node" in pod "calico-node-4j7td" is waiting to start: PodInitializing

大健的日常的博客 1万+

Applied Intelligence投稿经验分享(正在投稿中)

这几天在投稿Applied Intelligence这个期刊,过程很曲折,反反复复,因此写一篇经验分享,希望能记录一下自己的过程,也能给其他人一些帮助(可以在评论区讨论),提醒一下,一定要写一些声明,不会写、不知道写啥就看第四章的第二个问题。

weixin_55988068的博客 1万+

Manacher 算法详解:O(n) 复杂度求最长回文子串

先预处理下:在每个字符的两边都插入一个特殊的符号,比如abba变成#a#b#b#a#,aba变成#a#b#a#(因为Manacher算法只能处理奇数长度的字符串)。同时,为了避免数组越界,在字符串开头添加另一特殊符号,比如$#a#b#a#。 以字符串3212343219为例,处理后变成S[] = "$#3#2#1#2#3#4#3#2#1#9#"。 然后用一个数组Len[i]来记录以字符S[i

AC,∑ndless 4609

波分复用技术原理

波分复用原理 把不同波长的光信号复用到同一根光纤中进行传送,这种方式我们把它叫做波分复用( Wavelength Division Multiplexing ) 一根光纤被划分为多个波道,多个波长以一定的间隔隔开,在光纤中独立传输。 波分复用应用演示 如果将WDM系统看作交通系统,光纤可以看作是多个车道的公用道路。 各种类型的业务就像货物一样,被打包装载到车辆中。 车辆按照分配的车道行驶至目的地,完成货物的运输。 想要提高波分复用系统的传输容量,就要增加波道数量或是提升单波传...

m0_63251770的博客 9997

Codeforces Round #119 (Div. 2) / 189A Cut Ribbon (完全背包)

A. Cut Ribbon http://codeforces.com/problemset/problem/189/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 2675

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

Codeforces Round #105 (Div. 2) / 148A Insomnia cure (枚举 || 数论)

A. Insomnia cure http://codeforces.com/problemset/problem/148/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 2453

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

Codeforces Beta Round #74 (Div. 2) / 90B African Crossword (模拟)

B. African Crossword http://codeforces.com/problemset/problem/90%2FB time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard o

AC,∑ndless 2416

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

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

Codeforces Round #173 (Div. 2) / 282A Bit++(模拟)

A. Bit++ http://codeforces.com/problemset/problem/282/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 2227

Codeforces Round #235 (Div. 2) / 410D Roman and Numbers (带有整除性质的数位DP)

http://codeforces.com/problemset/problem/401/D 解释全部在代码的注释中: /*78ms,205464KB*/ #include using namespace std; const int mx = 1 << 18; long long dp[mx][100]; ///dp[mask][j]表示余数为j时的mask对应的x的个数 ///

AC,∑ndless 2198

Codeforces Round #194 (Div. 1) / 333A Secrets(贪心)

A. Secrets http://codeforces.com/contest/333/problem/A time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ge

AC,∑ndless 2041

Codeforces Beta Round #98 (Div. 2) / 137A Postcards and photos (模拟)

A. Postcards and photos http://codeforces.com/problemset/problem/137/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard

AC,∑ndless 2022

Codeforces Round #177 (Div. 1) / 288A Polo the Penguin and Strings(贪心)

A. Polo the Penguin and Strings http://codeforces.com/problemset/problem/288/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output

AC,∑ndless 1932

Codeforces Beta Round #75 (Div. 2) / 92B Binary Number(贪心)

B. Binary Number http://codeforces.com/problemset/problem/92/B time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 1931

Codeforces Round #183 (Div. 1) / 303A Lucky Permutation Triple (强大的数学&想法题)

http://codeforces.com/problemset/problem/303/A when n is odd, A[i] = B[i] = i when n is even, there is no solution. why? If , then  or just , where S = 0 + 1 + ... + n - 1 = n(n - 1) / 

AC,∑ndless 1915

Codeforces Round #237 (Div. 2) / 404C Restore Graph (构造最短路径树)

http://codeforces.com/contest/404/problem/C 思路:我们构造一颗最短路径树就行了。 若能够构造,边数必然为n-1(样例1的边数可以是两条)。 如何构造?从距离为1的点开始,逐渐往下加边,生成一颗k叉树。若在中间生成了大于k的叉,则输出-1。 完整代码: /*265ms,4436KB*/ #include using namesp

AC,∑ndless 1840

Codeforces Round #186 (Div. 2) / 313B Ilya and Queries (字符串处理)

B. Ilya and Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Ilya the Lion wants to help all his fri

AC,∑ndless 1810

【优化&大师级代码欣赏】Codeforces Round #137 (Div. 2) / 222B Cosmic Tables (矩阵)

B. Cosmic Tables http://codeforces.com/problemset/problem/222/B time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 1782
上一篇: Codeforces Round #178 (Div. 2) / 294A Shaass and Oskols(模拟)
下一篇: Codeforces Round #194 (Div. 2) / 334A Candy Bags(模拟)
synapse7
博客等级 码龄14年 432粉丝 701原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值