http://codeforces.com/problemset/problem/299/B

题意 :这个题挺简单的,就是说这个姑娘不喜欢走有石头的扇形,所以给你一个k的值,代表她一次可以跳多少扇形。

思路 :由于细节问题,那些循环的边界没弄好WA了几次,不过后来终于改对了。。。。

#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;
const int maxn = ;
char ch[maxn] ;
int main()
{
int n,k ;
scanf("%d %d",&n,&k);
int flag = ,j;
for(int i = ; i < n ; i++)
scanf("%c",&ch[i]) ;
for(int i = ; i < n ; i++)
{
if(ch[i] == '.'&&ch[i+] == '#')
{
for(j = i+ ; j <= k+i ; j++)
{
if(ch[j] != '#')
break ;
}
if(j == k+i+)
{
flag = ;
break ;
} }
}
if(flag)
printf("NO\n") ;
else
printf("YES\n") ;
return ;
}

CodeForces 299B Ksusha the Squirrel的更多相关文章

  1. CodeForces 299A Ksusha and Array

    http://codeforces.com/problemset/problem/299/A 题意 :输入n个数,要求找出一个数能让其他所有的数整除,如果没有的话输出-1.有多个的话输出其中一个. 思 ...

  2. Codeforces Round #328 (Div. 2) B. The Monster and the Squirrel 打表数学

    B. The Monster and the Squirrel Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/c ...

  3. codeforces 592B The Monster and the Squirrel

    题目链接:http://codeforces.com/contest/592/problem/B 题目分类:数学,找规律 题目分析:重要的是画图找规律   代码: #include<bits/s ...

  4. Codeforces Round #328 (Div. 2)_B. The Monster and the Squirrel

    B. The Monster and the Squirrel time limit per test 1 second memory limit per test 256 megabytes inp ...

  5. codeforces 592B/C

    题目链接:http://codeforces.com/contest/592/problem/B B. The Monster and the Squirrel time limit per test ...

  6. Squirrel: 通用SQL、NoSQL客户端

    安装 配置数据库 配置驱动 配置连接 如果你的工作中,需要使用到多个数据库,又不想在多种客户端之间切换来切换去.那么就需要找一款支持多数据库的客户端工具了.如果你要连接多个关系型数据库,你就可以使用N ...

  7. python爬虫学习(5) —— 扒一下codeforces题面

    上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...

  8. 【Codeforces 738D】Sea Battle(贪心)

    http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...

  9. 【Codeforces 738C】Road to Cinema

    http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...

随机推荐

  1. win32进阶之路:程序托盘图标+右键弹出菜单

     开场白 本次介绍两个非常棒且实用的技巧:程序托盘图标和右键弹出菜单,效果如下图. 程序托盘图标用了迅雷的图标,右键点击时候会弹出三个选项的菜单. 程序托盘图标设置 我会用尽可能清晰明了的步骤介绍方式 ...

  2. vs2012如何创建报表

    引自百度文库,介绍的比较详细 http://wenku.baidu.com/view/c405d5f48762caaedc33d405.html

  3. CentOS6.3系统安装SCP命令

    原文:http://www.111cn.net/sys/CentOS/58387.htm CP使用SSH协议在Linux系统中进行文件传输,但我最小安装的CentOS 6.3没有该命令.  代码如下 ...

  4. IOS-UI-UIDynamic(一)

    UIDynamic是从iOS7开始引入的技术 属于UIkit框架 可以模拟显示生活中的物理现象 如碰撞 抖动 摆动等 一. 使用UIDynamic步骤: 1.创建一个动力效果器UIDynamicAni ...

  5. javascript笔记---貌似大叔

    1.原型式继承和类式继承的区别 在基于类的面向对象方式中,对象(object)依靠类(class)来产生.而在基于原型的面向对象方式中,对象(object)则是依靠 构造器(constructor)利 ...

  6. 【Leetcode】357. Count Numbers with Unique Digits

    题目描述: Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. ...

  7. OOP—还原被遮掩的继承名称

    1.public继承——using 声明式 class Base { private: int x; public: ; virtual void mf1(int) ; virtual void mf ...

  8. VisualLeakDetector

    只需要#include "vld.h"就OK -------------------------------------- 找内存泄露挺方便的,比VS自带的详细.

  9. makefile--编译出现,未定义的字符

    ld: 0711-317 ERROR: Undefined symbol: .CEntityManager::SetParameter(CString,CString,SColumnInfo) /// ...

  10. shell命令行快速编辑命令

    ctrl r:命令行出现 reverse-i-search,输入字符将在输入历史中匹配命令 ctrl p:向前翻看历史 ctrl n:向后翻看历史 ctrl a:命令行首 ctrl e:命令行尾 ct ...