原题链接: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 模拟的更多相关文章

  1. Codeforces Round #325 (Div. 2) Laurenty and Shop 模拟

    原题链接:http://codeforces.com/contest/586/problem/B 题意: 大概就是给你一个两行的路,让你寻找一个来回的最短路,并且不能走重复的路. 题解: 就枚举上下选 ...

  2. Codeforces Round #368 (Div. 2) B. Bakery (模拟)

    Bakery 题目链接: http://codeforces.com/contest/707/problem/B Description Masha wants to open her own bak ...

  3. 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 ...

  4. 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 ...

  5. Codeforces Round #325 (Div. 2) A

    A. Alena's Schedule time limit per test 1 second memory limit per test 256 megabytes input standard ...

  6. Codeforces Round #325 (Div. 2)

    水 A - Alena's Schedule /************************************************ * Author :Running_Time * Cr ...

  7. 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 ...

  8. 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 ...

  9. 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 ...

随机推荐

  1. 给vmstat加上时间戳

    vmstat -n 5 | awk '{print strftime("[%Y-%m-%d %H:%M:%S]"),$0}' 或者 vmstat -n 5 | awk '{ pri ...

  2. 剑指offer-重建二叉树04

    题目描述 输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树.假设输入的前序遍历和中序遍历的结果中都不含重复的数字.例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7, ...

  3. hadoop-搭建(转)--亲测好用 (一)

    1)JDK软件 下载地址:http://www.oracle.com/technetwork/java/javase/index.html 2)Hadoop软件 下载地址:http://hadoop. ...

  4. Nginx出现500错误解决办法

    查看错误日志D:\nginx\logs\error.log 得知:Nginx配置文件中会将路径中的 \t 默认转义成 空格 改为双斜杠就可以了

  5. ubuntu安装出现"删除initramfs-tools时出错",subprocess installed post-installation script returned error exit status 1

    昨日准备重装ubuntu,增大了系统容量,因为前面用到boot分区不到100M,于是这里分区如下 /boot 100M / 30G /home 50G 然后安装快结束时就出现如下图问题 开始以为是镜像 ...

  6. mysql case when使用记录

    两种实现方式 第一种,CASE后面跟字段,当等于WHEN后面的值时,输出指定的数据 SELECT CASE gc.cat_id THEN '台球' THEN '羽毛球' ELSE '其它' END A ...

  7. atan 和 atan2

     转自http://blog.csdn.net/chinabinlang/article/details/6802686 atan函数与atan2函数的一点区别 . atan 和 atan2 都是求反 ...

  8. Linux中权限(r、w、x)对于目录与文件的意义

    Linux中权限(r.w.x)对于目录与文件的意义 一.权限对于目录的意义 1.首先要明白的是目录主要的内容是记录文件名列表和子目录列表,而不是实际存放数据的地方. 2.r权限:拥有此权限表示可以读取 ...

  9. 百度之星初赛(A)——T1

    小C的倍数问题 Problem Description 根据小学数学的知识,我们知道一个正整数x是3的倍数的条件是x每一位加起来的和是3的倍数.反之,如果一个数每一位加起来是3的倍数,则这个数肯定是3 ...

  10. C# datatable to list

    C# DataTable 和List之间相互转换的方法 好库文章 » 软件开发 » .NET » C# 发布者:好饱  发布日期:2013-1-27 22:17:49   更新日期:2013-1-27 ...