Croc Champ 2013 - Round 2 (Div. 2 Edition) B. Ksusha the Squirrel

#include 
#include 
#include 
#include 

using namespace std;

int main(){
    int n,k;
    cin >>n>>k;
    string ss;
    cin >> ss;
    bool isEnd = false;
    for(int i = 0; i < n; i ++ ){
        if(ss[i+1] == '#'){
            int j;
            for( j =i+1; j <= i+k; j ++ ){
                if( ss[j] == '.') break;
            }
            if(j <= i + k) i=j-1;
            else {isEnd = true; break;}
        }
    }
    if(isEnd) cout<<"NO"<

  

转载于:https://www.cnblogs.com/xiongqiangcs/archive/2013/04/23/3037006.html

你可能感兴趣的:(Croc Champ 2013 - Round 2 (Div. 2 Edition) B. Ksusha the Squirrel)