HDULive 7270
来源:互联网 发布:中科大网络教学平台 编辑:程序博客网 时间:2024/06/06 12:37
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5282
题意:读懂题后是一道超水超水的题。求分别以c 1开头,t 1开头的连续序列以及s的个数。代码如下,不知该怎么解释好了,最初错了易读错题意了。
#include<cstdio>#include<cstring>#include<algorithm>#include<iostream>using namespace std;int main(){ int n; while(~scanf("%d",&n)) { int ans=0; while(n--) { char c; cin>>c; if(c=='S') { ans++; } else { int t; cin>>t; if(t==1) ans++; } }cout<<ans<<endl; }}
0 0
- HDULive 7270
- UVALive 7270 Osu! Master 水题
- UVALive 7270 (hihoCoder 1258) Osu! Master
- UVALive 7270 Osu! Master(简单水题)
- Google PageRank算法解析
- 图结构练习——最小生成树
- 用数组模拟邻接表
- Oak先生-SurfaceView模拟游戏组合图形移动动画
- hdu 1176 (免费馅饼)
- HDULive 7270
- Qt---为窗体添加滚动条:QScrollArea
- unix环境高级编程-进程间通信(2)
- oracle invalide number错误
- 线段树 A Simple Problem with Integers
- java旅行第二站--JavaSE第六天--遍历目录
- POJ 2576 Tug of War
- POJ Problem 1745 Divisibility 【dp】
- Android学习之路-------Frangment碎片