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 ...
随机推荐
- 【已解决】UBuntu16.04软件中心更新后只有桌面
出现问题之前 安装好系统之后,成功启动系统,根据软件中心提示,升级电脑安装的软件,如下图所示.点击install(安装)开始更新,之后无任何提示,其实这个时候已经出现了升级异常. 呈现问题 操作步骤一 ...
- 2016-2017 ACM-ICPC, Egyptian Collegiate Programming Contest (ECPC 16)
A.The game of Osho(sg函数+二项展开) 题意: 一共有G个子游戏,一个子游戏有Bi, Ni两个数字.两名玩家开始玩游戏,每名玩家从N中减去B的任意幂次的数,直到不能操作判定为输.问 ...
- 用Spring注解的方式实现对某个网页的访问
本案例的目标是加强对@Controller @RequestMapping @Resource @Service 的感性认识,能过知道这几个注解是怎么用的,以及spring和springmvc ...
- Python实现队列
队列的数据结构的主要结构:一个结点类和两个方法:出队列和进队列 class Node(object): def __init__(self,val): self.val = val self.next ...
- Windows2008下RDP采用私有CA服务器证书搭建文档
在中小型公司建立企业根证书颁发机构 (CA) http://www.microsoft.com/china/smb/issues/sgc/articles/build_ent_root_ca.mspx ...
- ubuntu14 简单安装ffmpeg
1.简单安装 sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next sudo apt-get update sudo apt ...
- tips 前端 背景与元素的透明和模糊
碰到好几次这样的情况了: 一个带点儿文艺效果 背景图片模糊 而一行别致的文字清晰的悬浮在背景上(口胡,加点美好的想象,生活会更美好) 第一反应是 this is easy. cause i know ...
- BZOJ 2199: [Usaco2011 Jan]奶牛议会
2199: [Usaco2011 Jan]奶牛议会 Time Limit: 10 Sec Memory Limit: 259 MBSubmit: 375 Solved: 241[Submit][S ...
- 管理页面的类 PageHelper
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Da ...
- 搜索水题四连发_C++
特别声明:以下题目有部分为原创题,涉及版权问题,不得转载,违者追究 法律责任! 话说这是一套神题,只有你想不到,没有你做不到 题目更正后比 Pascal 跑得还快哈~ 一道特别裸,但是特别坑的搜索题 ...