codefoces round193a
link: http://codeforces.com/contest/332/problem/A
/*
ID: zypz4571
LANG: C++
TASK: 193a.cpp
*/ #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <algorithm>
#include <queue>
#include <deque>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <functional>
#include <fstream>
#include <iomanip>
#include <sstream>
#include <numeric>
#include <cassert>
#include <ctime>
#include <iterator>
const int INF = 0x3f3f3f3f;
const int dir[][] = {{-,},{,},{,-},{,},{-,-},{-,},{,-},{,}};
using namespace std;
char a[];
int main ( int argc, char *argv[] )
{
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
#endif
ios::sync_with_stdio(false);
int n; cin>>n;
cin>>a+;
int len = strlen(a+);
long long ans();
for (int i = ; i+n<=len; i+=n) {
if(a[i+n-]==a[i+n-]&&a[i+n-]==a[i+n-]) ans++;
}
cout<<ans<<endl;
return EXIT_SUCCESS;
} /* ---------- end of function main ---------- */
However, I can not understand the problem's meanning at first although it is so easy in fact.
It is time to train myself reading some problem and grasp it as quickly as possible.
codefoces round193a的更多相关文章
- Codefoces 432C Prime Swaps(数论+贪心)
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/u011328934/article/details/26094917 题目连接:Codefoces ...
- Codefoces 429 D. Tricky Function
裸的近期点对.... D. Tricky Function time limit per test 2 seconds memory limit per test 256 megabytes inpu ...
- Codefoces 432 C. Prime Swaps
哥德巴赫猜想: 任一大于2的偶数,都可表示成两个素数之和. 任一大于5的整数都可写成三个质数之和. 贪心取尽可能大的素数..... C. Prime Swaps time limit per test ...
- Codefoces 723B Text Document Analysis
B. Text Document Analysis time limit per test:1 second memory limit per test:256 megabytes input:sta ...
- Codefoces 723A The New Year: Meeting Friends
A. The New Year: Meeting Friends time limit per test:1 second memory limit per test:256 megabytes in ...
- Codefoces Gym 101652 【最大连续和】
<题目链接> 题目大意: 给你一段只由 'B'和'R'组成的字符串,问你在连续的区间内,"B"和"R"的差值最大是多少,输出该区间:如果对于差值相等 ...
- Codefoces 277 E. Binary Tree on Plane
题目链接:http://codeforces.com/problemset/problem/277/E 参考了这篇题解:http://blog.csdn.net/Sakai_Masato/articl ...
- Codefoces 432 C. Prime Swaps(水)
思路:从前往后想将1调整好,在调整2....这样平均每次有五次机会调整,并且有相当一部分可能都用不到五次,能够一试.ac 代码: #include<iostream> #include&l ...
- Codefoces 436 B. Om Nom and Spiders
纯属练习JAVA.... B. Om Nom and Spiders time limit per test 3 seconds memory limit per test 256 megabytes ...
随机推荐
- 过滤器 Filter
Filter(过滤器)简介 Filter 的基本功能是对发送到 Servlet 的请求进行拦截, 并对响应也进行拦截. Filter 程序是一个实现了 Filter 接口的 Java 类,与 Serv ...
- sql面向过程用法
sql可以看成是面向过程的编程语言.该语言中,有string.date.table这样的类型等等 一.操作表 sql相当于一个函数,输入是两个或多个表(A, B, ...) 求集合: 并集 union ...
- hdu 1069
//Accepted 264 KB 0 ms //每种block只有三种方法,且每种放法至多放一次 //规定三条边的顺序后 //把所有的block按x递增排序,x相同则按y递增排序 //然后dp // ...
- rcc
一.在STM32中,有五个时钟源,为HSI.HSE.LSI.LSE.PLL. 全名: high speed external ①HSI是高速内部时钟,RC振荡器,频率为8MHz. ②HSE是高 ...
- org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors
最近在项目中发现如下异常: 六月 25, 2015 5:58:34 下午 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet ...
- Python变量与常量
变量是计算机内存中的一块区域,变量可以存储规定范围内的值,而且值可以改变.基于变量的数据类型,解释器会分配指定内存,并决定什么数据可以被存储在内存中.常量是一块只读的内存区域,常量一旦被初始化就不能被 ...
- 【LeetCode OJ】Sum Root to Leaf Numbers
# Definition for a binary tree node # class TreeNode: # def __init__(self, x): # self.val = x # self ...
- ASP开发中服务器控件和普通控件的区别
1.对于服务器按钮控件(即<asp:Button>类型的按钮):服务器响应事件:OnClick客户端响应属性:OnClientClick 2.对于html按钮控件(即<input t ...
- HDU 4869 (递推 组合数取模)
Problem Turn the pokers (HDU 4869) 题目大意 有m张牌,全为正面朝上.进行n次操作,每次可以将任意ai张反面,询问n次操作可能的状态数. 解题分析 记正面朝上为1,朝 ...
- Inno Setup使用上的几个问题
Inno Setup使用上的几个问题 分类: Install Setup 2013-02-02 15:48 1781人阅读 评论(0) 收藏 举报 Inno Setup使用上的几个问题: [问题一:I ...