CodeForces 299B Ksusha the Squirrel
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的更多相关文章
- CodeForces 299A Ksusha and Array
http://codeforces.com/problemset/problem/299/A 题意 :输入n个数,要求找出一个数能让其他所有的数整除,如果没有的话输出-1.有多个的话输出其中一个. 思 ...
- 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 ...
- codeforces 592B The Monster and the Squirrel
题目链接:http://codeforces.com/contest/592/problem/B 题目分类:数学,找规律 题目分析:重要的是画图找规律 代码: #include<bits/s ...
- 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 ...
- codeforces 592B/C
题目链接:http://codeforces.com/contest/592/problem/B B. The Monster and the Squirrel time limit per test ...
- Squirrel: 通用SQL、NoSQL客户端
安装 配置数据库 配置驱动 配置连接 如果你的工作中,需要使用到多个数据库,又不想在多种客户端之间切换来切换去.那么就需要找一款支持多数据库的客户端工具了.如果你要连接多个关系型数据库,你就可以使用N ...
- python爬虫学习(5) —— 扒一下codeforces题面
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...
- 【Codeforces 738D】Sea Battle(贪心)
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...
- 【Codeforces 738C】Road to Cinema
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...
随机推荐
- 微软的技术态度 -- 从其对于CRT的设计考虑说起
很多人从C语言学习过来的人都知道,在编写程序时用到的像printf这样的函数,是作为该语言标准库函数提供的,这也是C语言标准中规定的内容.因此,操作系统必须对其保持一定程度上的透明,也就是说,作为一个 ...
- 设置TextView文字居中
有2种方法可以设置TextView文字居中: 一:在xml文件设置:android:gravity="center" 二:在程序中设置:m_TxtTitle.setGravity( ...
- 函数 swap
1,default swap namespace std { template<typename T> void swap( T& a, T& b) { T temp(a) ...
- QMessageBox 在MAC下更加自然
说明 在MAC写过QT程序的程序员应该都知道,QT默认的QMessageBox没有MAC系统的效果,在网上找到了一篇关于这方面的文章,但是这篇文章写的有个缺点,就是使用信号的方式,使用起来很不方便. ...
- ZStack中的编程技巧
1. 像函数一样使用的宏 //这个宏,用来被其他宏使用,构造一个正确有效的表达式.这个适合于一些离散语句的组合,不适合函数的重新命名 #define st(x) do { x } while ...
- Poj 2109 / OpenJudge 2109 Power of Cryptography
1.Link: http://poj.org/problem?id=2109 http://bailian.openjudge.cn/practice/2109/ 2.Content: Power o ...
- L013-oldboy-mysql-dba-lesson13
L013-oldboy-mysql-dba-lesson13 02 18:00 来自为知笔记(Wiz)
- Unity学习笔记(3):获取对象
在上一篇文章中(Unity映射注册)中概要介绍了Unity中的映射机制,本节主要介绍对象获取,包括默认获取,通过名称获取,获取全部对象,同时通过加载配置文件,然后再获取对象. 通过代码获取对象 方式1 ...
- strcmp的源码实现
微软方法: int __cdecl strcmp (const char *src, const char *dst) { ; while(!(ret = *(unsigned char *)src ...
- 使用tolua++编译pkg,从而创建自定义类让Lua脚本使用
步骤一:首先自定义类(这里Himi自定义类名 “MySprite”) MySprite.h 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 // // ...