五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

CF 299B - Ksusha the Squirrel

2023-08-21 12:16 作者:您是打尖兒還是住店呢  | 我要投稿

Ksusha the Squirrel is standing at the beginning of a straight road, divided into n sectors. The sectors are numbered 1 to n, from left to right. Initially, Ksusha stands in sector 1.


Ksusha wants to walk to the end of the road, that is, get to sector n. Unfortunately, there are some rocks on the road. We know that Ksusha hates rocks, so she doesn't want to stand in sectors that have rocks.


Ksusha the squirrel keeps fit. She can jump from sector i to any of the sectors i?+?1,?i?+?2,?...,?i?+?k.


Help Ksusha! Given the road description, say if she can reach the end of the road (note, she cannot stand on a rock)?


Input

The first line contains two integers n and k (2?≤?n?≤?3·105,?1?≤?k?≤?3·105). The next line contains n characters — the description of the road: the i-th character equals ".", if the i-th sector contains no rocks. Otherwise, it equals "#".


It is guaranteed that the first and the last characters equal ".".


Output

Print "YES" (without the quotes) if Ksusha can reach the end of the road, otherwise print "NO" (without the quotes).

------------------------------------------------

松鼠 Ksusha 站在一條筆直的道路的起點(diǎn),這條路分為 n 個(gè)部分。 扇區(qū)從左到右編號(hào)為 1 到 n。 最初,Ksusha 位于第 1 區(qū)。


Ksusha想要走到路的盡頭,即到達(dá)n區(qū)。 不幸的是,路上有一些石頭。 我們知道克蘇莎討厭巖石,所以她不想站在有巖石的區(qū)域。


松鼠 Ksusha 保持健康。 她可以從扇區(qū) i 跳轉(zhuǎn)到任意扇區(qū) i?+?1、?i?+?2、?...、?i?+?k。


幫助克蘇莎! 根據(jù)道路描述,假設(shè)她是否能到達(dá)路的盡頭(注意,她不能站在巖石上)?


輸入

第一行包含兩個(gè)整數(shù)n和k(2?≤?n?≤?3·105,?1?≤?k?≤?3·105)。 下一行包含 n 個(gè)字符——道路的描述:如果第 i 個(gè)扇區(qū)不包含巖石,則第 i 個(gè)字符等于“.”。 否則,它等于“#”。


保證第一個(gè)和最后一個(gè)字符等于“.”。


輸出

如果 Ksusha 可以到達(dá)路的盡頭,則打印“YES”(不帶引號(hào)),否則打印“NO”(不帶引號(hào))。

----------------------------------------

就是查詢是否有連續(xù)k個(gè)石頭即可;

下面是代碼:


CF 299B - Ksusha the Squirrel的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
瓮安县| 永济市| 惠来县| 灌阳县| 陆良县| 武威市| 绥德县| 安多县| 江津市| 当阳市| 涟水县| 密云县| 曲松县| 万源市| 柳江县| 三门县| 怀宁县| 寿宁县| 阳谷县| 稷山县| 红原县| 衢州市| 青浦区| 沈阳市| 丹凤县| 光山县| 涞水县| 嘉鱼县| 融水| 贵港市| 米泉市| 新泰市| 旬邑县| 内黄县| 板桥市| 宁国市| 买车| 黑龙江省| 锡林郭勒盟| 松潘县| 西城区|