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 |
---|---|---|---|---|---|---|
1380 | Educational Codeforces Round 91 (Rated for Div. 2) | FINISHED | False | 9000 | 142787711 | July 12, 2020, 2:45 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 14743 ) | B | Universal Solution | PROGRAMMING | greedy |
B'Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string s = s_1 s_2 ... s_{n} of length n where each letter is either R, S or P. While initializing, the bot is choosing a starting index pos ( 1 <= pos <= n ), and then it can play any number of rounds. In the first round, he chooses "Rock", "Scissors" or "Paper" based on the value of s_{pos} : In the second round, the bot 's choice is based on the value of s_{pos + 1} . In the third round -- on s_{pos + 2} and so on. After s_n the bot returns to s_1 and continues his game. You plan to play n rounds and you 've already figured out the string s but still don 't know what is the starting index pos . But since the bot 's tactic is so boring, you 've decided to find n choices to each round to maximize the average number of wins. In other words, let 's suggest your choices are c_1 c_2 ... c_n and if the bot starts from index pos then you 'll win in win(pos) rounds. Find c_1 c_2 ... c_n such that frac{win(1) + win(2) + ... + win(n)}{n} is maximum possible. The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. Next t lines contain test cases -- one per line. The first and only line of each test case contains string s = s_1 s_2 ... s_{n} ( 1 <= n <= 2 cdot 10^5 ; s_i in { text{R}, text{S}, text{P} } ) -- the string of the bot. It 's guaranteed that the total length of all strings in one test doesn 't exceed 2 cdot 10^5 . For each test case, print n choices c_1 c_2 ... c_n to maximize the average number of wins. Print them in the same manner as the string s . If there are multiple optimal answers, print any of them. In the first test case, the bot (wherever it starts) will always choose "Rock", so we can always choose "P'... |
Educational Codeforces Round 91 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
86685694 | Gassa | B | July 12, 2020, 4:18 p.m. | OK | D | TESTS | 5 | 46 | 8908800 | ||
86686070 | ruban | B | July 12, 2020, 4:20 p.m. | OK | Delphi | TESTS | 5 | 46 | 16896000 | ||
86692887 | duyanh1704 | B | July 12, 2020, 5:03 p.m. | OK | FPC | TESTS | 5 | 546 | 4812800 | ||
86674737 | singerl | B | July 12, 2020, 3:35 p.m. | OK | GNU C11 | TESTS | 5 | 15 | 4710400 | ||
86689559 | Amin.s | B | July 12, 2020, 4:40 p.m. | OK | GNU C11 | TESTS | 5 | 624 | 3891200 | ||
86705760 | Abrar_Al_Samit | B | July 12, 2020, 8:59 p.m. | OK | GNU C11 | TESTS | 5 | 639 | 3891200 | ||
86677981 | Wily_33 | B | July 12, 2020, 3:45 p.m. | OK | GNU C11 | TESTS | 5 | 639 | 3891200 | ||
86696167 | cristi.dana2 | B | July 12, 2020, 5:34 p.m. | OK | GNU C11 | TESTS | 5 | 639 | 3993600 | ||
86714184 | h_ritik | B | July 13, 2020, 3:11 a.m. | OK | GNU C11 | TESTS | 5 | 655 | 3686400 | ||
86685589 | MSF_Akatsuki | B | July 12, 2020, 4:17 p.m. | OK | GNU C++11 | TESTS | 5 | 15 | 3891200 | ||
86674614 | OMG_link | B | July 12, 2020, 3:35 p.m. | OK | GNU C++11 | TESTS | 5 | 15 | 3891200 | ||
86675663 | Branimir | B | July 12, 2020, 3:38 p.m. | OK | GNU C++11 | TESTS | 5 | 15 | 4096000 | ||
86672937 | fuxiaoxin | B | July 12, 2020, 3:30 p.m. | OK | GNU C++11 | TESTS | 5 | 15 | 4096000 | ||
86671161 | Forever_Pursuit | B | July 12, 2020, 3:25 p.m. | OK | GNU C++11 | TESTS | 5 | 15 | 4096000 | ||
86670341 | CongLingDanPaiShang2k5 | B | July 12, 2020, 3:23 p.m. | OK | GNU C++11 | TESTS | 5 | 15 | 4096000 | ||
86668367 | anson370 | B | July 12, 2020, 3:19 p.m. | OK | GNU C++11 | TESTS | 5 | 15 | 4096000 | ||
86710827 | withinlover | B | July 13, 2020, 1:03 a.m. | OK | GNU C++11 | TESTS | 5 | 15 | 4096000 | ||
86680268 | axiomofchoice | B | July 12, 2020, 3:53 p.m. | OK | GNU C++11 | TESTS | 5 | 15 | 4096000 | ||
86676653 | Charly52830 | B | July 12, 2020, 3:41 p.m. | OK | GNU C++11 | TESTS | 5 | 15 | 4300800 | ||
86682063 | tusm851 | B | July 12, 2020, 4 p.m. | OK | GNU C++14 | TESTS | 5 | 15 | 4198400 | ||
86718572 | Aa_Aanegola | B | July 13, 2020, 5:06 a.m. | OK | GNU C++14 | TESTS | 5 | 15 | 4198400 | ||
86711773 | shinigaami | B | July 13, 2020, 1:43 a.m. | OK | GNU C++14 | TESTS | 5 | 15 | 4198400 | ||
86687782 | Free_fire | B | July 12, 2020, 4:29 p.m. | OK | GNU C++14 | TESTS | 5 | 15 | 4198400 | ||
86680662 | TheLethalCode | B | July 12, 2020, 3:55 p.m. | OK | GNU C++14 | TESTS | 5 | 15 | 4198400 | ||
86721100 | nilesh_gup | B | July 13, 2020, 5:51 a.m. | OK | GNU C++14 | TESTS | 5 | 15 | 4300800 | ||
86715816 | aakash125 | B | July 13, 2020, 4:02 a.m. | OK | GNU C++14 | TESTS | 5 | 15 | 4300800 | ||
86714645 | FallenTitan | B | July 13, 2020, 3:26 a.m. | OK | GNU C++14 | TESTS | 5 | 15 | 4300800 | ||
86713538 | Zareer_Zowad | B | July 13, 2020, 2:49 a.m. | OK | GNU C++14 | TESTS | 5 | 15 | 4300800 | ||
86699802 | arundhatib | B | July 12, 2020, 6:32 p.m. | OK | GNU C++14 | TESTS | 5 | 15 | 4300800 | ||
86703618 | prashantnh143 | B | July 12, 2020, 7:57 p.m. | OK | GNU C++17 | TESTS | 5 | 15 | 4198400 | ||
86673384 | shubham107 | B | July 12, 2020, 3:31 p.m. | OK | GNU C++17 | TESTS | 5 | 15 | 4198400 | ||
86672644 | Chocobar | B | July 12, 2020, 3:29 p.m. | OK | GNU C++17 | TESTS | 5 | 15 | 4198400 | ||
86674060 | rishit3234 | B | July 12, 2020, 3:33 p.m. | OK | GNU C++17 | TESTS | 5 | 15 | 4198400 | ||
86679113 | bhavsar | B | July 12, 2020, 3:49 p.m. | OK | GNU C++17 | TESTS | 5 | 15 | 4198400 | ||
86696590 | vivix_123 | B | July 12, 2020, 5:41 p.m. | OK | GNU C++17 | TESTS | 5 | 15 | 4198400 | ||
86698107 | luniankit28 | B | July 12, 2020, 6:02 p.m. | OK | GNU C++17 | TESTS | 5 | 15 | 4198400 | ||
86699409 | shashmehul02 | B | July 12, 2020, 6:25 p.m. | OK | GNU C++17 | TESTS | 5 | 15 | 4198400 | ||
86702497 | Ruturaj_Godse | B | July 12, 2020, 7:30 p.m. | OK | GNU C++17 | TESTS | 5 | 15 | 4198400 | ||
86716357 | Coding_Sourabh | B | July 13, 2020, 4:16 a.m. | OK | GNU C++17 | TESTS | 5 | 15 | 4300800 | ||
86695863 | FflashkingF | B | July 12, 2020, 5:30 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 15 | 4812800 | ||
86720374 | soymilk | B | July 13, 2020, 5:39 a.m. | OK | GNU C++17 (64) | TESTS | 5 | 15 | 4812800 | ||
86709221 | davidSC | B | July 12, 2020, 11:27 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 15 | 4812800 | ||
86708667 | smax | B | July 12, 2020, 10:55 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 15 | 4812800 | ||
86701986 | tugsuu | B | July 12, 2020, 7:18 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 15 | 4812800 | ||
86701904 | Mangooste | B | July 12, 2020, 7:16 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 15 | 4812800 | ||
86698592 | anurag122898 | B | July 12, 2020, 6:10 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 15 | 4812800 | ||
86697259 | marksman_ | B | July 12, 2020, 5:49 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 15 | 4812800 | ||
86696965 | MZuenni | B | July 12, 2020, 5:46 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 15 | 4812800 | ||
86694973 | jdvoid_44 | B | July 12, 2020, 5:20 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 15 | 4812800 | ||
86711613 | Russell_Emerine | B | July 13, 2020, 1:36 a.m. | OK | Haskell | TESTS | 5 | 155 | 23142400 | ||
86700022 | avijit_agarwal | B | July 12, 2020, 6:36 p.m. | OK | Java 11 | TESTS | 5 | 155 | 23756800 | ||
86719759 | throughHell | B | July 13, 2020, 5:28 a.m. | OK | Java 11 | TESTS | 5 | 171 | 23756800 | ||
86717443 | jash_07 | B | July 13, 2020, 4:43 a.m. | OK | Java 11 | TESTS | 5 | 171 | 23756800 | ||
86714249 | Oopsimbad | B | July 13, 2020, 3:14 a.m. | OK | Java 11 | TESTS | 5 | 171 | 23756800 | ||
86698348 | aryankhatri | B | July 12, 2020, 6:06 p.m. | OK | Java 11 | TESTS | 5 | 171 | 23756800 | ||
86693099 | kumarpritam863 | B | July 12, 2020, 5:05 p.m. | OK | Java 11 | TESTS | 5 | 171 | 23756800 | ||
86686147 | nafiz6 | B | July 12, 2020, 4:20 p.m. | OK | Java 11 | TESTS | 5 | 171 | 23756800 | ||
86683990 | an09mous | B | July 12, 2020, 4:09 p.m. | OK | Java 11 | TESTS | 5 | 171 | 23756800 | ||
86680598 | blackBird | B | July 12, 2020, 3:54 p.m. | OK | Java 11 | TESTS | 5 | 171 | 23756800 | ||
86672354 | mphillotry | B | July 12, 2020, 3:29 p.m. | OK | Java 11 | TESTS | 5 | 171 | 23756800 | ||
86672190 | atfiona | B | July 12, 2020, 3:28 p.m. | OK | Java 8 | TESTS | 5 | 93 | 20377600 | ||
86661450 | CF_is_my_GF | B | July 12, 2020, 3 p.m. | OK | Java 8 | TESTS | 5 | 93 | 20480000 | ||
86706912 | mayankarora21 | B | July 12, 2020, 9:41 p.m. | OK | Java 8 | TESTS | 5 | 108 | 20377600 | ||
86695359 | sudhanshu_lucky | B | July 12, 2020, 5:24 p.m. | OK | Java 8 | TESTS | 5 | 108 | 20377600 | ||
86679024 | abc_000 | B | July 12, 2020, 3:48 p.m. | OK | Java 8 | TESTS | 5 | 108 | 20377600 | ||
86670310 | rohan03 | B | July 12, 2020, 3:23 p.m. | OK | Java 8 | TESTS | 5 | 108 | 20377600 | ||
86686157 | ragnarok001 | B | July 12, 2020, 4:20 p.m. | OK | Java 8 | TESTS | 5 | 108 | 20480000 | ||
86711954 | shivamnarware | B | July 13, 2020, 1:51 a.m. | OK | Java 8 | TESTS | 5 | 108 | 20480000 | ||
86684880 | O_E | B | July 12, 2020, 4:13 p.m. | OK | Java 8 | TESTS | 5 | 108 | 20480000 | ||
86684267 | vicky2810 | B | July 12, 2020, 4:10 p.m. | OK | Java 8 | TESTS | 5 | 108 | 20480000 | ||
86700034 | Loremon | B | July 12, 2020, 6:37 p.m. | OK | JavaScript | TESTS | 5 | 31 | 6041600 | ||
86680006 | sylvyrfysh | B | July 12, 2020, 3:52 p.m. | OK | Kotlin | TESTS | 5 | 139 | 21504000 | ||
86673507 | andy.gusev | B | July 12, 2020, 3:32 p.m. | OK | Kotlin | TESTS | 5 | 140 | 20684800 | ||
86673427 | Tlatoani | B | July 12, 2020, 3:31 p.m. | OK | Kotlin | TESTS | 5 | 140 | 20889600 | ||
86678054 | kelvinc1024 | B | July 12, 2020, 3:45 p.m. | OK | Kotlin | TESTS | 5 | 140 | 22220800 | ||
86672936 | golions | B | July 12, 2020, 3:30 p.m. | OK | Kotlin | TESTS | 5 | 155 | 20889600 | ||
86686121 | STommydx | B | July 12, 2020, 4:20 p.m. | OK | Kotlin | TESTS | 5 | 171 | 20992000 | ||
86687201 | STommydx | B | July 12, 2020, 4:25 p.m. | OK | Kotlin | TESTS | 5 | 171 | 21094400 | ||
86698735 | wbars | B | July 12, 2020, 6:13 p.m. | OK | Kotlin | TESTS | 5 | 171 | 21708800 | ||
86691507 | misoft | B | July 12, 2020, 4:54 p.m. | OK | Kotlin | TESTS | 5 | 764 | 21299200 | ||
86701686 | Mosyagin | B | July 12, 2020, 7:11 p.m. | OK | Mono C# | TESTS | 5 | 46 | 10342400 | ||
86672889 | Backs | B | July 12, 2020, 3:30 p.m. | OK | Mono C# | TESTS | 5 | 78 | 15462400 | ||
86676102 | Mushegh | B | July 12, 2020, 3:39 p.m. | OK | MS C++ | TESTS | 5 | 31 | 4300800 | ||
86699715 | kobratooth | B | July 12, 2020, 6:30 p.m. | OK | MS C++ 2017 | TESTS | 5 | 30 | 4403200 | ||
86673980 | SPOON796 | B | July 12, 2020, 3:33 p.m. | OK | MS C++ 2017 | TESTS | 5 | 30 | 4505600 | ||
86674748 | JulesIMF | B | July 12, 2020, 3:35 p.m. | OK | MS C++ 2017 | TESTS | 5 | 30 | 4608000 | ||
86684133 | dddttdCF | B | July 12, 2020, 4:09 p.m. | OK | MS C++ 2017 | TESTS | 5 | 31 | 4198400 | ||
86707108 | nzhirnov | B | July 12, 2020, 9:48 p.m. | OK | MS C++ 2017 | TESTS | 5 | 31 | 4300800 | ||
86709815 | gbanuel3 | B | July 13, 2020, 12:05 a.m. | OK | MS C++ 2017 | TESTS | 5 | 31 | 4300800 | ||
86706162 | Monitorz | B | July 12, 2020, 9:13 p.m. | OK | MS C++ 2017 | TESTS | 5 | 31 | 4300800 | ||
86686340 | Phil0 | B | July 12, 2020, 4:21 p.m. | OK | MS C++ 2017 | TESTS | 5 | 31 | 4300800 | ||
86679832 | letshavesomefun | B | July 12, 2020, 3:51 p.m. | OK | MS C++ 2017 | TESTS | 5 | 31 | 4300800 | ||
86674106 | samarth9421 | B | July 12, 2020, 3:33 p.m. | OK | MS C++ 2017 | TESTS | 5 | 31 | 4300800 | ||
86689238 | Darooha | B | July 12, 2020, 4:38 p.m. | OK | Ocaml | TESTS | 5 | 31 | 3993600 | ||
86684282 | a1ikeda | B | July 12, 2020, 4:10 p.m. | OK | Perl | TESTS | 5 | 46 | 3072000 | ||
86681949 | realnimish | B | July 12, 2020, 4 p.m. | OK | PyPy 2 | TESTS | 5 | 108 | 25497600 | ||
86676195 | starkizard | B | July 12, 2020, 3:39 p.m. | OK | PyPy 2 | TESTS | 5 | 124 | 26316800 | ||
86671272 | bazzyadb | B | July 12, 2020, 3:26 p.m. | OK | PyPy 2 | TESTS | 5 | 140 | 25088000 | ||
86680262 | sksshivam007 | B | July 12, 2020, 3:53 p.m. | OK | PyPy 2 | TESTS | 5 | 140 | 26726400 | ||
86669910 | pajenegod | B | July 12, 2020, 3:22 p.m. | OK | PyPy 2 | TESTS | 5 | 155 | 25292800 | ||
86671584 | alexwice | B | July 12, 2020, 3:26 p.m. | OK | PyPy 2 | TESTS | 5 | 171 | 25395200 | ||
86671878 | zacker-22 | B | July 12, 2020, 3:27 p.m. | OK | PyPy 2 | TESTS | 5 | 249 | 31436800 | ||
86720906 | Rajdeep2k | B | July 13, 2020, 5:48 a.m. | OK | PyPy 3 | TESTS | 5 | 155 | 22323200 | ||
86677256 | Sameer-Mann | B | July 12, 2020, 3:43 p.m. | OK | PyPy 3 | TESTS | 5 | 155 | 22323200 | ||
86674349 | raj1307 | B | July 12, 2020, 3:34 p.m. | OK | PyPy 3 | TESTS | 5 | 155 | 22425600 | ||
86697875 | srkvrm | B | July 12, 2020, 5:59 p.m. | OK | PyPy 3 | TESTS | 5 | 155 | 22630400 | ||
86692071 | KA_Rma | B | July 12, 2020, 4:58 p.m. | OK | PyPy 3 | TESTS | 5 | 155 | 22630400 | ||
86672491 | Khan17 | B | July 12, 2020, 3:29 p.m. | OK | PyPy 3 | TESTS | 5 | 170 | 22630400 | ||
86671766 | qazz625 | B | July 12, 2020, 3:27 p.m. | OK | PyPy 3 | TESTS | 5 | 171 | 22323200 | ||
86687465 | nitrawf | B | July 12, 2020, 4:27 p.m. | OK | PyPy 3 | TESTS | 5 | 171 | 22630400 | ||
86684893 | codershuvo | B | July 12, 2020, 4:13 p.m. | OK | PyPy 3 | TESTS | 5 | 171 | 22630400 | ||
86703544 | BigBrainInsane | B | July 12, 2020, 7:55 p.m. | OK | PyPy 3 | TESTS | 5 | 171 | 22835200 | ||
86701238 | ComptineDunAutreEte | B | July 12, 2020, 7 p.m. | OK | Python 2 | TESTS | 5 | 156 | 6963200 | ||
86680305 | junmiao | B | July 12, 2020, 3:53 p.m. | OK | Python 2 | TESTS | 5 | 202 | 11878400 | ||
86685711 | abhishekm71 | B | July 12, 2020, 4:18 p.m. | OK | Python 2 | TESTS | 5 | 218 | 8704000 | ||
86715905 | HJPASIMK | B | July 13, 2020, 4:04 a.m. | OK | Python 3 | TESTS | 5 | 93 | 7270400 | ||
86692826 | incognito__ | B | July 12, 2020, 5:03 p.m. | OK | Python 3 | TESTS | 5 | 93 | 7680000 | ||
86689118 | indigenous | B | July 12, 2020, 4:37 p.m. | OK | Python 3 | TESTS | 5 | 93 | 8089600 | ||
86678830 | kingmoshe | B | July 12, 2020, 3:48 p.m. | OK | Python 3 | TESTS | 5 | 108 | 7065600 | ||
86689211 | Maverick_007 | B | July 12, 2020, 4:38 p.m. | OK | Python 3 | TESTS | 5 | 108 | 7270400 | ||
86686083 | ashik.mahmud | B | July 12, 2020, 4:20 p.m. | OK | Python 3 | TESTS | 5 | 108 | 7577600 | ||
86673167 | _andyli | B | July 12, 2020, 3:31 p.m. | OK | Python 3 | TESTS | 5 | 108 | 7987200 | ||
86675006 | darthrevenge | B | July 12, 2020, 3:36 p.m. | OK | Python 3 | TESTS | 5 | 108 | 8704000 | ||
86718117 | MohanPutti | B | July 13, 2020, 4:57 a.m. | OK | Python 3 | TESTS | 5 | 109 | 7270400 | ||
86717857 | singhpriyank | B | July 13, 2020, 4:50 a.m. | OK | Python 3 | TESTS | 5 | 109 | 7270400 | ||
86667576 | fatemender | B | July 12, 2020, 3:18 p.m. | OK | Rust | TESTS | 5 | 46 | 4505600 | ||
86695645 | pandrei | B | July 12, 2020, 5:28 p.m. | OK | Rust | TESTS | 5 | 46 | 4710400 | ||
86713630 | sansen | B | July 13, 2020, 2:53 a.m. | OK | Rust | TESTS | 5 | 46 | 5734400 | ||
86670032 | robostac | B | July 12, 2020, 3:22 p.m. | OK | Rust | TESTS | 5 | 46 | 9830400 | ||
86681556 | IvanDyachenko | B | July 12, 2020, 3:58 p.m. | OK | Scala | TESTS | 5 | 545 | 39833600 | ||
86702509 | IvanDyachenko | B | July 12, 2020, 7:30 p.m. | OK | Scala | TESTS | 5 | 545 | 39936000 | ||
86671753 | limed | B | July 12, 2020, 3:27 p.m. | OK | Scala | TESTS | 5 | 545 | 40038400 | ||
86673904 | byte | B | July 12, 2020, 3:33 p.m. | OK | Scala | TESTS | 5 | 561 | 39833600 | ||
86703110 | smas | B | July 12, 2020, 7:44 p.m. | OK | Scala | TESTS | 5 | 577 | 40652800 |
Back to search problems