Codeforces Global Round 11

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
1427 Codeforces Global Round 11 FINISHED False 10800 129481799 Oct. 10, 2020, 2:50 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10954 ) B Chess Cheater PROGRAMMING greedy implementation sortings 1400

B'You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you get 0 points. When you win you get 1 or 2 points: if you have won also the previous game you get 2 points, otherwise you get 1 point. If you win the very first game of the tournament you get 1 point (since there is not a "previous game"). The outcomes of the n games are represented by a string s of length n : the i -th character of s is W if you have won the i -th game, while it is L if you have lost the i -th game. After the tournament, you notice a bug on the website that allows you to change the outcome of at most k of your games (meaning that at most k times you can change some symbol L to W, or W to L). Since your only goal is to improve your chess rating, you decide to cheat and use the bug. Compute the maximum score you can get by cheating in the optimal way. Each test contains multiple test cases. The first line contains an integer t ( 1 <= t <= 20,000 ) -- the number of test cases. The description of the test cases follows. The first line of each testcase contains two integers n, k ( 1 <= n <= 100,000 , 0 <= k <= n ) xe2 x80 x93 the number of games played and the number of outcomes that you can change. The second line contains a string s of length n containing only the characters W and L. If you have won the i -th game then s_i= , W, if you have lost the i -th game then s_i= , L. It is guaranteed that the sum of n over all testcases does not exceed 200,000 . For each testcase, print a single integer xe2 x80 x93 the maximum score you can get by cheating in the optimal way. Explanation of the first testcase. Before changing any outcome, the score is 2 . Indeed, you won the first game, so you got 1 point, an'...

Tutorials

Editorial of Global Round 11

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
95175560 ruban B Oct. 11, 2020, 5:47 a.m. OK Delphi TESTS 33 202 133017600 1400
95149230 Xacman B Oct. 10, 2020, 6:24 p.m. OK GNU C11 TESTS 33 93 512000 1400
95153432 babaiserror B Oct. 10, 2020, 7:19 p.m. OK GNU C11 TESTS 33 93 2969600 1400
95169183 blackzebra B Oct. 11, 2020, 3:33 a.m. OK GNU C++11 TESTS 33 31 614400 1400
95170712 kmyiu B Oct. 11, 2020, 4:16 a.m. OK GNU C++11 TESTS 33 31 716800 1400
95167681 HaoxuanXIE B Oct. 11, 2020, 2:50 a.m. OK GNU C++11 TESTS 33 31 716800 1400
95168613 river11355 B Oct. 11, 2020, 3:15 a.m. OK GNU C++11 TESTS 33 31 1126400 1400
95171787 AsilenceBTF B Oct. 11, 2020, 4:40 a.m. OK GNU C++11 TESTS 33 31 1126400 1400
95139848 Rain_luo B Oct. 10, 2020, 5:12 p.m. OK GNU C++11 TESTS 33 31 1433600 1400
95142036 study_ing B Oct. 10, 2020, 5:24 p.m. OK GNU C++11 TESTS 33 31 2048000 1400
95166138 HHHEN B Oct. 11, 2020, 1:54 a.m. OK GNU C++11 TESTS 33 31 5017600 1400
95137712 1827405109 B Oct. 10, 2020, 5 p.m. OK GNU C++11 TESTS 33 31 9011200 1400
95167129 ubospica B Oct. 11, 2020, 2:30 a.m. OK GNU C++11 TESTS 33 46 512000 1400
95133195 jiraiya_777 B Oct. 10, 2020, 4:38 p.m. OK GNU C++14 TESTS 33 31 307200 1400
95147299 ayushg977 B Oct. 10, 2020, 5:49 p.m. OK GNU C++14 TESTS 33 31 512000 1400
95134478 1101_ B Oct. 10, 2020, 4:44 p.m. OK GNU C++14 TESTS 33 31 614400 1400
95172332 Kapil_Bishnoi B Oct. 11, 2020, 4:52 a.m. OK GNU C++14 TESTS 33 31 716800 1400
95169028 saurav1717 B Oct. 11, 2020, 3:28 a.m. OK GNU C++14 TESTS 33 31 716800 1400
95167731 codead404 B Oct. 11, 2020, 2:51 a.m. OK GNU C++14 TESTS 33 31 716800 1400
95167307 anhkha1004 B Oct. 11, 2020, 2:37 a.m. OK GNU C++14 TESTS 33 31 716800 1400
95158038 abdalkader-s B Oct. 10, 2020, 8:50 p.m. OK GNU C++14 TESTS 33 31 716800 1400
95173759 theirfanukani B Oct. 11, 2020, 5:18 a.m. OK GNU C++14 TESTS 33 31 716800 1400
95175954 mds_10 B Oct. 11, 2020, 5:53 a.m. OK GNU C++14 TESTS 33 31 716800 1400
95136961 Brother_mohit B Oct. 10, 2020, 4:56 p.m. OK GNU C++17 TESTS 33 31 512000 1400
95136302 Eileen_99 B Oct. 10, 2020, 4:53 p.m. OK GNU C++17 TESTS 33 31 512000 1400
95171446 CCSU_Cola B Oct. 11, 2020, 4:33 a.m. OK GNU C++17 TESTS 33 31 512000 1400
95168752 yession B Oct. 11, 2020, 3:20 a.m. OK GNU C++17 TESTS 33 31 512000 1400
95175031 lifehappiness B Oct. 11, 2020, 5:39 a.m. OK GNU C++17 TESTS 33 31 614400 1400
95149299 xb0nS B Oct. 10, 2020, 6:25 p.m. OK GNU C++17 TESTS 33 31 614400 1400
95134818 MikhailovBair B Oct. 10, 2020, 4:45 p.m. OK GNU C++17 TESTS 33 31 614400 1400
95176282 rx_direwolf B Oct. 11, 2020, 5:58 a.m. OK GNU C++17 TESTS 33 31 716800 1400
95173124 OneAutumLeaf B Oct. 11, 2020, 5:06 a.m. OK GNU C++17 TESTS 33 31 716800 1400
95175709 sidjoharwal B Oct. 11, 2020, 5:49 a.m. OK GNU C++17 TESTS 33 31 716800 1400
95160969 samchen123 B Oct. 10, 2020, 10:10 p.m. OK GNU C++17 (64) TESTS 33 31 716800 1400
95159201 keepers B Oct. 10, 2020, 9:18 p.m. OK GNU C++17 (64) TESTS 33 31 716800 1400
95159196 sameerg2300 B Oct. 10, 2020, 9:18 p.m. OK GNU C++17 (64) TESTS 33 31 716800 1400
95158886 madlogic B Oct. 10, 2020, 9:10 p.m. OK GNU C++17 (64) TESTS 33 31 716800 1400
95157753 teapotd B Oct. 10, 2020, 8:43 p.m. OK GNU C++17 (64) TESTS 33 31 716800 1400
95176004 airforceone747 B Oct. 11, 2020, 5:54 a.m. OK GNU C++17 (64) TESTS 33 31 716800 1400
95160736 conquizztador B Oct. 10, 2020, 10:03 p.m. OK GNU C++17 (64) TESTS 33 31 716800 1400
95158615 elManco B Oct. 10, 2020, 9:04 p.m. OK GNU C++17 (64) TESTS 33 31 819200 1400
95157857 mdjobayairhossain2020 B Oct. 10, 2020, 8:46 p.m. OK GNU C++17 (64) TESTS 33 31 1024000 1400
95133385 essi B Oct. 10, 2020, 4:38 p.m. OK GNU C++17 (64) TESTS 33 31 1433600 1400
95168657 sam_code B Oct. 11, 2020, 3:16 a.m. OK Java 11 TESTS 33 187 0 1400
95174877 srjvastri8 B Oct. 11, 2020, 5:36 a.m. OK Java 11 TESTS 33 202 0 1400
95168259 sam_code B Oct. 11, 2020, 3:07 a.m. OK Java 11 TESTS 33 202 0 1400
95159530 bckslsh03 B Oct. 10, 2020, 9:27 p.m. OK Java 11 TESTS 33 202 0 1400
95159496 bckslsh03 B Oct. 10, 2020, 9:26 p.m. OK Java 11 TESTS 33 202 0 1400
95145429 kiel.dowdle B Oct. 10, 2020, 5:42 p.m. OK Java 11 TESTS 33 217 0 1400
95134371 akman10 B Oct. 10, 2020, 4:43 p.m. OK Java 11 TESTS 33 217 0 1400
95148431 Sexydog B Oct. 10, 2020, 6:19 p.m. OK Java 11 TESTS 33 218 0 1400
95137254 vlam21 B Oct. 10, 2020, 4:58 p.m. OK Java 11 TESTS 33 218 0 1400
95136612 blackBird B Oct. 10, 2020, 4:55 p.m. OK Java 11 TESTS 33 218 0 1400
95152096 kareem3id B Oct. 10, 2020, 6:59 p.m. OK Java 8 TESTS 33 124 0 1400
95151089 overACer B Oct. 10, 2020, 6:45 p.m. OK Java 8 TESTS 33 124 0 1400
95134701 gagan_6730 B Oct. 10, 2020, 4:45 p.m. OK Java 8 TESTS 33 124 0 1400
95148842 remain_calm B Oct. 10, 2020, 6:21 p.m. OK Java 8 TESTS 33 139 0 1400
95146039 RockStar_14 B Oct. 10, 2020, 5:45 p.m. OK Java 8 TESTS 33 139 0 1400
95139553 rachitpts.2454 B Oct. 10, 2020, 5:10 p.m. OK Java 8 TESTS 33 139 0 1400
95170999 O-infinity B Oct. 11, 2020, 4:23 a.m. OK Java 8 TESTS 33 140 0 1400
95156766 flyman3046 B Oct. 10, 2020, 8:21 p.m. OK Java 8 TESTS 33 140 0 1400
95141202 AALEXX B Oct. 10, 2020, 5:20 p.m. OK Java 8 TESTS 33 140 0 1400
95139455 mayankarora21 B Oct. 10, 2020, 5:09 p.m. OK Java 8 TESTS 33 140 0 1400
95148250 lyaskovec B Oct. 10, 2020, 6:18 p.m. OK JavaScript TESTS 33 295 2969600 1400
95152238 Tlatoani B Oct. 10, 2020, 7:01 p.m. OK Kotlin TESTS 33 155 0 1400
95141047 slemus B Oct. 10, 2020, 5:19 p.m. OK Kotlin TESTS 33 327 1843200 1400
95133979 chanter B Oct. 10, 2020, 4:41 p.m. OK Kotlin TESTS 33 390 0 1400
95160910 wllw2011 B Oct. 10, 2020, 10:09 p.m. OK MS C++ TESTS 33 109 819200 1400
95135561 Elmahdy B Oct. 10, 2020, 4:49 p.m. OK MS C++ 2017 TESTS 33 62 819200 1400
95160293 UriAv B Oct. 10, 2020, 9:50 p.m. OK MS C++ 2017 TESTS 33 62 6860800 1400
95160173 allFiredUp B Oct. 10, 2020, 9:46 p.m. OK MS C++ 2017 TESTS 33 62 6860800 1400
95160884 ustaritz B Oct. 10, 2020, 10:08 p.m. OK MS C++ 2017 TESTS 33 124 716800 1400
95139884 Oscer.Jack B Oct. 10, 2020, 5:12 p.m. OK MS C++ 2017 TESTS 33 124 716800 1400
95159612 pyrological B Oct. 10, 2020, 9:30 p.m. OK MS C++ 2017 TESTS 33 139 614400 1400
95133604 psn2706 B Oct. 10, 2020, 4:39 p.m. OK MS C++ 2017 TESTS 33 139 1433600 1400
95160946 ustaritz B Oct. 10, 2020, 10:10 p.m. OK MS C++ 2017 TESTS 33 140 716800 1400
95133960 mydrecz2601 B Oct. 10, 2020, 4:41 p.m. OK MS C++ 2017 TESTS 33 155 1024000 1400
95140858 Myao B Oct. 10, 2020, 5:18 p.m. OK MS C++ 2017 TESTS 33 155 1126400 1400
95159865 kit.shiron B Oct. 10, 2020, 9:37 p.m. OK PyPy 2 TESTS 33 218 13619200 1400
95135475 Mukundan314 B Oct. 10, 2020, 4:49 p.m. OK PyPy 2 TESTS 33 233 7270400 1400
95157903 zii.hrs B Oct. 10, 2020, 8:47 p.m. OK PyPy 3 TESTS 33 249 9113600 1400
95139018 marroncastle B Oct. 10, 2020, 5:07 p.m. OK PyPy 3 TESTS 33 280 7168000 1400
95149072 Rudresh B Oct. 10, 2020, 6:23 p.m. OK PyPy 3 TESTS 33 280 8192000 1400
95174648 codershuvo B Oct. 11, 2020, 5:32 a.m. OK PyPy 3 TESTS 33 280 13414400 1400
95174607 YMSeah B Oct. 11, 2020, 5:31 a.m. OK PyPy 3 TESTS 33 296 9113600 1400
95135894 Shankhadeep B Oct. 10, 2020, 4:51 p.m. OK PyPy 3 TESTS 33 311 9420800 1400
95173446 YMSeah B Oct. 11, 2020, 5:12 a.m. OK PyPy 3 TESTS 33 327 14336000 1400
95140444 kaleabasfaw2010 B Oct. 10, 2020, 5:15 p.m. OK PyPy 3 TESTS 33 358 9830400 1400
95150295 shanu_im B Oct. 10, 2020, 6:35 p.m. OK PyPy 3 TESTS 33 358 14438400 1400
95148608 ghoshashis545 B Oct. 10, 2020, 6:20 p.m. OK PyPy 3 TESTS 33 405 9932800 1400
95169472 eugalt B Oct. 11, 2020, 3:41 a.m. OK Python 3 TESTS 33 358 1331200 1400
95150727 sh1194 B Oct. 10, 2020, 6:41 p.m. OK Python 3 TESTS 33 373 1228800 1400
95175745 bluej B Oct. 11, 2020, 5:50 a.m. OK Python 3 TESTS 33 374 1433600 1400
95170574 eugalt B Oct. 11, 2020, 4:12 a.m. OK Python 3 TESTS 33 374 1433600 1400
95165621 sxx B Oct. 11, 2020, 1:33 a.m. OK Python 3 TESTS 33 405 1024000 1400
95161474 IngaleAnkur10 B Oct. 10, 2020, 10:25 p.m. OK Python 3 TESTS 33 420 1126400 1400
95153889 swagsy2000 B Oct. 10, 2020, 7:27 p.m. OK Python 3 TESTS 33 451 1331200 1400
95155292 mlycheetv B Oct. 10, 2020, 7:52 p.m. OK Python 3 TESTS 33 452 2252800 1400
95134181 ucantfindme B Oct. 10, 2020, 4:42 p.m. OK Python 3 TESTS 33 452 2355200 1400
95135942 twarnakula B Oct. 10, 2020, 4:51 p.m. OK Python 3 TESTS 33 483 1126400 1400
95150934 quickn_babo B Oct. 10, 2020, 6:43 p.m. OK Rust TESTS 33 46 1536000 1400

remove filters

Back to search problems