Codeforces Round #325 (Div. 2) Alena's Schedule 模拟
原题链接:http://codeforces.com/contest/586/problem/A
题意:
大概就是给你个序列。。瞎比让你统计统计什么长度
题解:
就瞎比搞搞就好
代码:
#include<iostream>
#include<cstring>
#include<vector>
#include<algorithm>
#define MAX_N 123
using namespace std; int n;
int a[MAX_N];
int main(){
cin>>n;
for(int i=;i<n;i++)cin>>a[i];
int cnt=;
for(int i=;i<n-;i++)
if(a[i-]&&a[i+])a[i]=;
for(int i=;i<n;i++)cnt+=a[i];
cout<<cnt<<endl;
return ;
}
Codeforces Round #325 (Div. 2) Alena's Schedule 模拟的更多相关文章
- Codeforces Round #325 (Div. 2) Laurenty and Shop 模拟
原题链接:http://codeforces.com/contest/586/problem/B 题意: 大概就是给你一个两行的路,让你寻找一个来回的最短路,并且不能走重复的路. 题解: 就枚举上下选 ...
- Codeforces Round #368 (Div. 2) B. Bakery (模拟)
Bakery 题目链接: http://codeforces.com/contest/707/problem/B Description Masha wants to open her own bak ...
- Codeforces Round #325 (Div. 2) A. Alena's Schedule 水题
A. Alena's Schedule Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/586/pr ...
- Codeforces Round #325 (Div. 2) A. Alena's Schedule 暴力枚举 字符串
A. Alena's Schedule time limit per test 1 second memory limit per test 256 megabytes input standard ...
- Codeforces Round #325 (Div. 2) A
A. Alena's Schedule time limit per test 1 second memory limit per test 256 megabytes input standard ...
- Codeforces Round #325 (Div. 2)
水 A - Alena's Schedule /************************************************ * Author :Running_Time * Cr ...
- Codeforces Round #284 (Div. 2)A B C 模拟 数学
A. Watching a movie time limit per test 1 second memory limit per test 256 megabytes input standard ...
- Codeforces Round #285 (Div. 2) A B C 模拟 stl 拓扑排序
A. Contest time limit per test 1 second memory limit per test 256 megabytes input standard input out ...
- Codeforces Round #325 (Div. 2) F. Lizard Era: Beginning meet in the mid
F. Lizard Era: Beginning Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/5 ...
随机推荐
- 【java并发编程实战】第二章:对象的共享
1.重要的属性 可见性,不变性,原子性 1.1可见性 当一个线程修改某个对象状态的时候,我们希望其他线程也能看到发生后的变化. 在没有同步的情况下,编译器和处理器会对代码的执行顺序进行重排.以提高效率 ...
- Python全栈工程师(包、模块 的导入)
ParisGabriel 每天坚持手写 一天一篇 决定坚持几年 为了梦想 为了信仰 Python人工智能从入门到精通 $ pip3 install tenso ...
- 孤荷凌寒自学python第三天 初识序列
孤荷凌寒自学python第三天 初识序列 (完整学习过程屏幕记录视频地址在文末,手写笔记在文末) Python的序列非常让我着迷,之前学习的其它编程语言中没有非常特别关注过序列这种类型的对象,而pyt ...
- web浏览器中的javascript
window 对象中其中一个最重要的属性是document,它引用document对象,后者表示显示在窗口中的文档.document对象有一些重要方法,比如getElementById(),它可以基于 ...
- MVC学习笔记---WebViewPage(nop等开源项目的@T)
http://www.cnblogs.com/gyche/p/5597491.html http://www.cnblogs.com/Alex80/p/5369042.html http://www. ...
- C#学习笔记----静态字段和静态方法
1.使用关键字 static 修饰的字段或方法成为静态字段和静态方法,如 public static int num = 1;2.静态字段属于类,并为类所用.而非静态字段属于对象,只能被特定的对象专有 ...
- 16个简单实用的.htaccess技巧
.htaccess 文件 (Hypertext Access file) 是Apache Web服务器的一个非常强大的配置文件,对于这个文件,Apache有一堆参数可以让你配置出几乎随心所欲的功能.. ...
- weex & web app & vue
weex & web app & vue https://weex-project.io/tools/playground.html https://weex.apache.org/ ...
- RabbitMQ vhost 配置
RabbitMQ vhost 配置 rabbitmqctl set_vhost_limits是用来定义虚拟主机限制的命令 配置最大连接限制 要限制vhost vhost_name中并发客户端连接的 总 ...
- MPLAB设置路径
大家都知道在MPLAB环境下编译程序,c文件.h文件.编译器生成的文件等等,都会被编译器无情的放在一个项目文件夹下. 稍微有些讲究的程序员可能就会觉得用MPLAB项目组织的一团糟.于是大家想到了一种方 ...