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 ...
随机推荐
- Dreamweaver标签库
.highlight .hll { background-color: #ffffcc } .highlight { background: #ffffff } .highlight .c { col ...
- OC3_选择器
// // Dog.h // OC3_选择器 // // Created by zhangxueming on 15/6/16. // Copyright (c) 2015年 zhangxueming ...
- ImageLoader(多线程网络图片加载)+本地缓存 for windowsphone 7
搞了好长一阵子wp,做点好事. C/S手机app中应用最多的是 获取网络图片,缓存到本地,展示图片 本次主要对其中的delay:LowProfileImageLoader进行修改,在获取图片的时候, ...
- jQuery学习教程(1)
一.什么是jQuery JQuery是继prototype之后又一个优秀的Javascript库.它是轻量级的js库 ,它兼容CSS3,还兼容各种浏览器(IE 6.0+, FF 1.5+, Safar ...
- StreamReader和StreamWrite与FileStream区别
具体用法不在赘述. 记录一下用法的区别 StreamReader: FileStream fs = new FileStream(@"D:\Readme.txt",FileMode ...
- mysql日期时间操作
select curdate(); --获取当前日期 select last_day(curdate()); --获取当月最后一天. select DATE_ADD(curdate(),interva ...
- linux 输入子系统(2)----简单实例分析系统结构(input_dev层)
实例代码如下: #include <linux/input.h> #include <linux/module.h> #include <linux/init.h> ...
- PIL 安装
1.安装依赖包 1.1 ubuntu安装 apt-get install python-devapt-get install libjpeg-dev apt-get install libjpeg8- ...
- ThinkPHP I方法
ThinkPHP的I方法是3.1.3版本新增的,如果你是之前的3.*版本的话,可以直接参考使用3.1快速入门教程系列的变量部分. 概述 正如你所见到的一样,I方法是ThinkPHP众多单字母函数中的新 ...
- DemoExample
<HTML> <HEAD> <TITLE>使用递归求解斐波那契数列</TITLE> </HEAD> <BODY> <?ph ...