题目传送门

 /*
水!
*/
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std; const int MAXN = 1e2 + ;
const int INF = 0x3f3f3f3f;
char s[MAXN]; int main(void) //CodeForces 137A Postcards and photos
{
// freopen ("E.in", "r", stdin); while (scanf ("%s", s) == )
{
int len = strlen (s);
int ans = ; int i = ;
while (i < len)
{
char ch = s[i]; int cnt = ;
while (cnt < && i < len)
{
if (s[i+] == ch)
{
++cnt; ++i;
}
else break;
}
ans++; i++;
} printf ("%d\n", ans);
} return ;
}

水题 CodeForces 137A Postcards and photos的更多相关文章

  1. 水题 Codeforces Round #302 (Div. 2) A Set of Strings

    题目传送门 /* 题意:一个字符串分割成k段,每段开头字母不相同 水题:记录每个字母出现的次数,每一次分割把首字母的次数降为0,最后一段直接全部输出 */ #include <cstdio> ...

  2. 水题 Codeforces Round #300 A Cutting Banner

    题目传送门 /* 水题:一开始看错题意,以为是任意切割,DFS来做:结果只是在中间切出一段来 判断是否余下的是 "CODEFORCES" :) */ #include <cs ...

  3. 水题 Codeforces Round #299 (Div. 2) A. Tavas and Nafas

    题目传送门 /* 很简单的水题,晚上累了,刷刷水题开心一下:) */ #include <bits/stdc++.h> using namespace std; ][] = {" ...

  4. 水题 Codeforces Round #304 (Div. 2) A. Soldier and Bananas

    题目传送门 /* 水题:ans = (1+2+3+...+n) * k - n,开long long */ #include <cstdio> #include <algorithm ...

  5. 水题 Codeforces Round #303 (Div. 2) A. Toy Cars

    题目传送门 /* 题意:5种情况对应对应第i或j辆车翻了没 水题:其实就看对角线的上半边就可以了,vis判断,可惜WA了一次 3: if both cars turned over during th ...

  6. 水题 Codeforces Round #286 (Div. 2) A Mr. Kitayuta's Gift

    题目传送门 /* 水题:vector容器实现插入操作,暴力进行判断是否为回文串 */ #include <cstdio> #include <iostream> #includ ...

  7. 构造水题 Codeforces Round #206 (Div. 2) A. Vasya and Digital Root

    题目传送门 /* 构造水题:对于0的多个位数的NO,对于位数太大的在后面补0,在9×k的范围内的平均的原则 */ #include <cstdio> #include <algori ...

  8. 水题 Codeforces Round #306 (Div. 2) A. Two Substrings

    题目传送门 /* 水题:遍历一边先找AB,再BA,再遍历一边先找BA,再AB,两种情况满足一种就YES */ #include <cstdio> #include <iostream ...

  9. 水题 Codeforces Round #308 (Div. 2) A. Vanya and Table

    题目传送门 /* 水题:读懂题目就能做 */ #include <cstdio> #include <iostream> #include <algorithm> ...

随机推荐

  1. jsp页面根据json数据动态生成table

    根据需求由于不同的表要在同一个jsp展示,点击某个表名便显示某张表内容,对于java后台传给jsp页面的json形式的数据是怎么动态生成table的呢? 找了好久,终于找到某位前辈的答案,在此表示衷心 ...

  2. NOIP2018普及游记

    我好弱啊,今年又是考pj啊 今年GD的又是在我们学校有考点(gzez) 考前其实还是蛮紧张的,毕竟考砸了就AFO了.我dp是真的弱,模拟赛连最长下降子序列都不会写,心想要是T3是dp就咕咕咕了.去年那 ...

  3. 走进矩阵树定理--「CodePlus 2017 12 月赛」白金元首与独舞

    n,m<=200,n*m的方阵,有ULRD表示在这个格子时下一步要走到哪里,有一些待决策的格子用.表示,可以填ULRD任意一个,问有多少种填法使得从每个格子出发都能走出这个方阵,答案取模.保证未 ...

  4. JVM(五):探究类加载过程-上

    JVM(五):探究类加载过程-上 本文我们来研究一个Java字节码文件(Class文件)是如何加载入内存中的,在這個过程中涉及类加载过程中的加载,验证,准备,解析(连接),初始化,使用,销毁过程,并探 ...

  5. Eclipse-Java代码规范和质量检查插件-阿里编码规约

    此工具配套阿里巴巴Java开发手册:http://www.cnblogs.com/EasonJim/p/6436387.html Eclipse安装和使用方法:https://github.com/a ...

  6. jenkinsapi出现HTTPConnectionPool Max retires exceeded异常

    python项目通过使用jenkinsapi远程控制jenkins jenkinsapi使用的远程连接方法是requests包,requests包又使用了urllib3,urllib3又引用了http ...

  7. Android: Mac无法找到Android SDK问题

    通过brew cask install android-sdk后,Intellij Idea中设置Android SDK路径失败,解决方法如下: /usr/local/Caskroom/android ...

  8. AutoCAD如何编辑块,打散块

    选中块之后,点击最右侧的最后一个工具"分解"即可.  

  9. webpack-入口篇

    入口起点[Entry Points]: 单个入口(简写)语法 用法:entry: string|Array<string> 例子(webpack.config.js) const conf ...

  10. Android系统之路(初识MTK) ------ OTA打包ROM安装系统img等到ZIP

    在做OTA升级包的时候,我编译了好多次都没过.老是IO异常.刚開始以为是我 make 的错误.后来多次检查 Error 发现是我的配置信息写错了,与驱动project师一起检查源代码, 改动配置信息后 ...