Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
---|---|---|---|---|---|---|
1506 | Codeforces Round 710 (Div. 3) | FINISHED | False | 7200 | 115140299 | March 25, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 20279 ) | B | Partial Replacement | PROGRAMMING | greedy implementation |
B"You are given a number k and a string s of length n , consisting of the characters '.' and '*'. You want to replace some of the '*' characters with 'x' characters so that the following conditions are met: For example, if n=7 , s= .**.*** and k=3 , then the following strings will satisfy the conditions above: Given n , k , and s , find the minimum number of '*' characters that must be replaced with 'x' in order to meet the above conditions. The first line contains one integer t ( 1 <= t <= 500 ). Then t test cases follow. The first line of each test case contains two integers n and k ( 1 <= k <= n <= 50 ). The second line of each test case contains a string s of length n , consisting of the characters '.' and '*'. It is guaranteed that there is at least one '*' in the string s . It is guaranteed that the distance between any two neighboring '*' characters does not exceed k . For each test case output the minimum number of '*' characters that must be replaced with 'x' characters in order to satisfy the conditions above. "... |
Editorial |
No solutions yet.