CodeForces 688AOpponents
来源:互联网 发布:跑步路线规划软件 编辑:程序博客网 时间:2024/06/06 04:41
题目链接:http://codeforces.com/problemset/problem/688/A
题目大意:如果一行数字全是1失败,有0则成功,求最大成功次数
简单的水题。。。
代码如下:
#include<algorithm>#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<iostream>using namespace std;int main(){ int a, b; int sum = 0, cnt = 0; scanf("%d%d",&a, &b); for(int i = 0; i < b; i++) { char c[1005] = {0}; scanf("%s", c); int f= 0; for(int j = 0; j < a; j++) { if(c[j] == '0') { f = 1; break; } } if(f==1) cnt++; else cnt=0; sum=max(sum,cnt); } printf("%d\n",sum);}
0 0
- CodeForces 688AOpponents
- Codeforces-688A Opponents
- CodeForces 688 B
- CodeForces 688 A
- CodeForces 688A
- CodeForces 688BLovely Palindromes
- codeforces 688D
- CodeForces 688A Opponents
- codeforces 688A Opponents
- codeforces~~~
- Codeforces
- codeforces
- Codeforces
- codeforces
- codeforces
- Codeforces
- Codeforces
- CodeForces
- 完成端口模型
- XZ_iOS之使用webView加载后台返回的一串html代码,HTML中的图片不显示
- 电商秒杀系统-数据库表设计
- Atom Editor for Windows 插件安装方法
- kail install chinese
- CodeForces 688AOpponents
- C# winForm启动最小化到任务栏右侧通知栏并交互操作
- For the payment term field in the order
- iOS开源加密相册Agony的实现(三)
- 使用fastjson和xUtils框架来获取聚合笑话数据
- jQuery Mobile 笔记三
- 由一个简单示例 引出java继承中父子类成员变量共享问题 以及super的使用
- ng-if
- POJ 3176 Cow Bowling(基础DP)