codeforces 688A Opponents
来源:互联网 发布:html5单页面静态源码 编辑:程序博客网 时间:2024/06/06 12:56
点击打开链接
题意:有d次比赛,每次n个人,当n个人都来时,就输了,否则就赢,问连续能赢的最大次数。
#include<cstdio>#include<iostream>#include<algorithm>#include<cstring>typedef long long ll;using namespace std;const ll mod=100000000;int main(){ int n,d; cin>>n>>d; char str[110]; int ma=0,s=0,ans=0; for(int i=0; i<d; i++) { cin>>str; s=0; int len=strlen(str); for(int j=0; j<len; j++) s+=str[j]-'0'; //cout<<s<<' '<<n<<endl; if(s==n) { ma=max(ma,ans); ans=0; } else ans++; } ma=max(ma,ans); cout<<ma<<endl; //cout<<s<<' '<<n<<endl; return 0;}
阅读全文
0 0
- Codeforces-688A Opponents
- CodeForces 688A Opponents
- codeforces 688A Opponents
- CodeForces 688A Opponents(群架)
- 688A: Opponents
- Codeforces Round #360 (Div. 2) A. Opponents
- Codeforces Round #360 (Div. 2) A. Opponents
- Codeforces Round #360 (Div. 2) A. Opponents
- A. Opponents
- Codeforces Round #360 (Div. 2) A Opponents(水题)
- Codeforces Round #360 (Div. 2) A. Opponents(水题)
- Opponents
- Opponents
- CodeForces 688 A
- CodeForces 688A
- CodeForces-a
- Codeforces 903A A
- CodeForces 18A A - Triangle
- java经典面试题(4)
- c++函数的传值方式
- 记录Hbuilder项目使用xcode离线打包上传苹果商店踩过的坑
- 廖雪峰老师个人网站推荐
- MySQL索引的优化
- codeforces 688A Opponents
- POJ 3070 Fibonacci 矩阵快速幂
- 详解Linux-I2C驱动(硬件原理\驱动分析\测试)
- px4基本知识
- py-faster-rcnn/models/pascal_voc/ZF/faster_rcnn_alt_opt/stage1_fast_rcnn_train.pt
- 数字签名(1):RSA
- 【Android】【MTK】MTK系统启动流程
- Fiddler支持捕获Firefox请求
- ARM裸机从零开始的学习1--基础概念