题意:一段01串 分割成段 每段只能有一个1 问一段串有多少种分割方式

思路:两个1之间有一个0就有两种分割方式,然后根据分步乘法原理来做、

(不过这里有一组0 1 0这种数据的话就不好直接处理,所以遇到第一个1才开始标记)

 #include<iostream>
using namespace std;
int main()
{
long long l=;
int n;
cin>>n;
int a;
int j=;
int s=;
for(int i=;i<n;i++)
{
cin>>a;
if(s)
{
if(a==){
l*=j+;
j=;}
else
j++;
}
if(a== && s!=)
s=,l=;
}
cout<<l;
}

最新文章

  1. ASP.NET MVC 视图(四)
  2. Oracle数据库初级学习 2
  3. LINUX软件./configure 配置出现:configure: error: newly created file is older than distributed files!
  4. SecureCRT rz 上传文件失败问题
  5. SPRING IN ACTION 第4版笔记-第四章ASPECT-ORIENTED SPRING-012-AOP总结
  6. ArcGIS 在地图上添加标注
  7. [转]iOS hybrid App 的实现原理及性能监测
  8. mysql 的事务
  9. RTL-SDR基础环境安装
  10. 彻底解决tap“点透”,提升移动端点击响应速度
  11. 1305: Substring
  12. create a new table for the query results
  13. Mybatis3.4.0不支持mybatis-spring1.2.5及以下版本
  14. js中常用的正则表达式总结
  15. Sql Server2014数据库清理日志
  16. 论文笔记:Siamese Cascaded Region Proposal Networks for Real-Time Visual Tracking
  17. python2 python3 转换,兼容
  18. python windows 安装sklearn
  19. eclipse maven maven-compiler-plugin 报错 完全解决
  20. Android权限管理

热门文章

  1. WPF数据绑定详解
  2. mac Chrome 快捷键
  3. linux系统命令配置文件
  4. 深入浅出Cocoa之消息【转】
  5. python 利用csv模块导入数据
  6. codechef Heavy-light Decompositions
  7. Ubuntu里node命令无效解决方法
  8. importError: DLL load failed when import matplotlib.pyplot as plt
  9. 块级元素及内联元素对margin、padding的态度
  10. [React Native]StatusBar的使用