Codeforces Round 657 (Div. 2)

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
1379 Codeforces Round 657 (Div. 2) FINISHED False 7200 142030763 July 19, 2020, 9 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12021 ) A Acacius and String PROGRAMMING brute force implementation strings 1500

B'Acacius is studying strings theory. Today he came with the following problem. You are given a string s of length n consisting of lowercase English letters and question marks. It is possible to replace question marks with lowercase English letters in such a way that a string "abacaba" occurs as a substring in a resulting string exactly once? Each question mark should be replaced with exactly one lowercase English letter. For example, string "a?b?c" can be transformed into strings "aabbc" and "azbzc", but can 't be transformed into strings "aabc", "a?bbc" and "babbc". Occurrence of a string t of length m in the string s of length n as a substring is a index i ( 1 <= q i <= q n - m + 1 ) such that string s[i..i+m-1] consisting of m consecutive symbols of s starting from i -th equals to string t . For example string "ababa" has two occurrences of a string "aba" as a substring with i = 1 and i = 3 , but there are no occurrences of a string "aba" in the string "acba" as a substring. Please help Acacius to check if it is possible to replace all question marks with lowercase English letters in such a way that a string "abacaba" occurs as a substring in a resulting string exactly once. First line of input contains an integer T ( 1 <= q T <= q 5000 ), number of test cases. T pairs of lines with test case descriptions follow. The first line of a test case description contains a single integer n ( 7 <= q n <= q 50 ), length of a string s . The second line of a test case description contains string s of length n consisting of lowercase English letters and question marks. For each test case output an answer for it. In case if there is no way to replace question marks in string s with a lowercase English letters in such a way that there is exactly one occurrence of a string "abacaba" in the resulting string as a substring output "No". Other'...

Tutorials

Codeforces Round #657 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
87367716 Bogdan_Lukomsky A July 19, 2020, 3:31 p.m. OK FPC TESTS 6 93 3584000 1500
87317931 singerl A July 19, 2020, 10:06 a.m. OK GNU C11 TESTS 6 46 3686400 1500
87374045 human_shu A July 19, 2020, 5:02 p.m. OK GNU C11 TESTS 6 46 3686400 1500
87375814 sai.tharun A July 19, 2020, 5:34 p.m. OK GNU C11 TESTS 7 530 3686400 1500
87365395 hnust_liaotianb A July 19, 2020, 3:04 p.m. OK GNU C++11 TESTS 6 15 3686400 1500
87331106 wallflowerlm A July 19, 2020, 10:36 a.m. OK GNU C++11 TESTS 6 15 3891200 1500
87324110 RainAir A July 19, 2020, 10:20 a.m. OK GNU C++11 TESTS 6 15 3891200 1500
87313651 _int_me A July 19, 2020, 9:57 a.m. OK GNU C++11 TESTS 6 15 3891200 1500
87394728 yueqian A July 20, 2020, 3:10 a.m. OK GNU C++11 TESTS 7 15 3891200 1500
87340348 DesZou A July 19, 2020, 10:56 a.m. OK GNU C++11 TESTS 6 15 3891200 1500
87335154 pdfqwq A July 19, 2020, 10:45 a.m. OK GNU C++11 TESTS 6 15 3891200 1500
87363869 Vixbob A July 19, 2020, 2:47 p.m. OK GNU C++11 TESTS 6 15 4198400 1500
87392050 yuzhechuan A July 20, 2020, 2 a.m. OK GNU C++11 TESTS 7 30 3891200 1500
87392733 yuanyuxuan A July 20, 2020, 2:19 a.m. OK GNU C++11 TESTS 7 30 3891200 1500
87318475 ro777 A July 19, 2020, 10:07 a.m. OK GNU C++14 TESTS 6 15 3686400 1500
87313635 violet72 A July 19, 2020, 9:57 a.m. OK GNU C++14 TESTS 6 15 3788800 1500
87401673 naman1409 A July 20, 2020, 5:58 a.m. OK GNU C++14 TESTS 7 15 3891200 1500
87368957 Pyder_ A July 19, 2020, 3:46 p.m. OK GNU C++14 TESTS 6 30 3686400 1500
87367581 human_shu A July 19, 2020, 3:29 p.m. OK GNU C++14 TESTS 6 30 3686400 1500
87366655 fighter11 A July 19, 2020, 3:19 p.m. OK GNU C++14 TESTS 6 30 3686400 1500
87363084 jk_896 A July 19, 2020, 2:39 p.m. OK GNU C++14 TESTS 6 30 3686400 1500
87396125 Ashish8897 A July 20, 2020, 3:47 a.m. OK GNU C++14 TESTS 7 30 3686400 1500
87371565 Mahedi001 A July 19, 2020, 4:22 p.m. OK GNU C++14 TESTS 6 30 3686400 1500
87401243 Sherlocked_221B A July 20, 2020, 5:52 a.m. OK GNU C++14 TESTS 7 30 3686400 1500
87308827 macrony A July 19, 2020, 9:48 a.m. OK GNU C++17 TESTS 6 15 3686400 1500
87393318 hope_it_ac A July 20, 2020, 2:34 a.m. OK GNU C++17 TESTS 7 15 3686400 1500
87356493 subratadutta12 A July 19, 2020, 1:28 p.m. OK GNU C++17 TESTS 6 15 3686400 1500
87315327 _runtimeTerror_ A July 19, 2020, 10:01 a.m. OK GNU C++17 TESTS 6 15 3686400 1500
87349488 snehan1234567 A July 19, 2020, 12:15 p.m. OK GNU C++17 TESTS 6 15 3891200 1500
87326394 brightsun A July 19, 2020, 10:25 a.m. OK GNU C++17 TESTS 6 15 3891200 1500
87391243 Void_Monitor A July 20, 2020, 1:34 a.m. OK GNU C++17 TESTS 7 30 3686400 1500
87399214 dhiraj_7_ A July 20, 2020, 5:14 a.m. OK GNU C++17 TESTS 7 30 3686400 1500
87391353 Sajjat004 A July 20, 2020, 1:38 a.m. OK GNU C++17 TESTS 7 30 3686400 1500
87386060 Red-Dragon A July 19, 2020, 9:27 p.m. OK GNU C++17 TESTS 7 30 3686400 1500
87334579 sayan_244 A July 19, 2020, 10:44 a.m. OK GNU C++17 (64) TESTS 6 15 4300800 1500
87371500 Arnab_Bhattacharjee A July 19, 2020, 4:22 p.m. OK GNU C++17 (64) TESTS 6 30 4300800 1500
87356504 hironeko99 A July 19, 2020, 1:29 p.m. OK GNU C++17 (64) TESTS 6 30 4300800 1500
87349252 harsh639 A July 19, 2020, 12:13 p.m. OK GNU C++17 (64) TESTS 6 30 4300800 1500
87335780 __Achilles A July 19, 2020, 10:46 a.m. OK GNU C++17 (64) TESTS 6 30 4300800 1500
87325626 viel_ubung A July 19, 2020, 10:23 a.m. OK GNU C++17 (64) TESTS 6 30 4300800 1500
87321088 tata666 A July 19, 2020, 10:13 a.m. OK GNU C++17 (64) TESTS 6 30 4300800 1500
87392332 balraj.babrah A July 20, 2020, 2:08 a.m. OK GNU C++17 (64) TESTS 7 30 4300800 1500
87393190 vjudge1 A July 20, 2020, 2:31 a.m. OK GNU C++17 (64) TESTS 7 30 4300800 1500
87385111 ggdwbg A July 19, 2020, 8:55 p.m. OK GNU C++17 (64) TESTS 7 30 4300800 1500
87323065 dblokhin A July 19, 2020, 10:17 a.m. OK Go TESTS 6 77 10854400 1500
87308778 Hasker A July 19, 2020, 9:48 a.m. OK Haskell TESTS 6 61 11673600 1500
87377547 litesam A July 19, 2020, 6:04 p.m. OK Java 11 TESTS 7 187 24371200 1500
87374861 In_The_Name_Of_Love A July 19, 2020, 5:17 p.m. OK Java 11 TESTS 7 187 24371200 1500
87333977 Tatsuyaaaa A July 19, 2020, 10:42 a.m. OK Java 11 TESTS 6 187 24371200 1500
87365225 tirtho2107 A July 19, 2020, 3:02 p.m. OK Java 11 TESTS 6 187 24576000 1500
87337835 DreamInfinite A July 19, 2020, 10:51 a.m. OK Java 11 TESTS 6 202 24678400 1500
87322686 devesh08 A July 19, 2020, 10:17 a.m. OK Java 11 TESTS 6 218 24371200 1500
87310542 RockStar_14 A July 19, 2020, 9:51 a.m. OK Java 11 TESTS 6 233 24985600 1500
87341490 nb_3018 A July 19, 2020, 10:58 a.m. OK Java 11 TESTS 6 233 26521600 1500
87338272 vivek21 A July 19, 2020, 10:52 a.m. OK Java 11 TESTS 6 248 25088000 1500
87312838 GrandZeno A July 19, 2020, 9:56 a.m. OK Java 11 TESTS 6 249 24985600 1500
87367066 Whiplash99 A July 19, 2020, 3:24 p.m. OK Java 8 TESTS 6 109 20992000 1500
87323032 desp__beginner A July 19, 2020, 10:17 a.m. OK Java 8 TESTS 6 109 20992000 1500
87309074 Faizan A July 19, 2020, 9:48 a.m. OK Java 8 TESTS 6 109 21094400 1500
87373141 labdhi A July 19, 2020, 4:48 p.m. OK Java 8 TESTS 6 109 21094400 1500
87349465 piyush33patel A July 19, 2020, 12:15 p.m. OK Java 8 TESTS 6 109 21094400 1500
87334517 shashwat07 A July 19, 2020, 10:44 a.m. OK Java 8 TESTS 6 109 21094400 1500
87388326 kostasanemozalis A July 19, 2020, 11 p.m. OK Java 8 TESTS 7 109 21299200 1500
87357250 noobie_code A July 19, 2020, 1:36 p.m. OK Java 8 TESTS 6 109 21299200 1500
87351964 Vaibhav_patel19 A July 19, 2020, 12:39 p.m. OK Java 8 TESTS 6 109 21606400 1500
87350924 anuj560 A July 19, 2020, 12:28 p.m. OK Java 8 TESTS 6 109 21606400 1500
87344372 Loremon A July 19, 2020, 11:34 a.m. OK JavaScript TESTS 6 186 10240000 1500
87315853 kelvinc1024 A July 19, 2020, 10:02 a.m. OK Kotlin TESTS 6 140 21606400 1500
87381054 mishagam A July 19, 2020, 7:14 p.m. OK Kotlin TESTS 7 202 21811200 1500
87328976 koboshi A July 19, 2020, 10:31 a.m. OK Kotlin TESTS 6 264 23654400 1500
87316071 axtrez A July 19, 2020, 10:02 a.m. OK Kotlin TESTS 6 686 21811200 1500
87332051 hibatibati A July 19, 2020, 10:38 a.m. OK Mono C# TESTS 6 61 14540800 1500
87338090 fiver A July 19, 2020, 10:51 a.m. OK Mono C# TESTS 6 92 225894400 1500
87378454 amit1509kumar A July 19, 2020, 6:20 p.m. OK Mono C# TESTS 7 93 15360000 1500
87313063 terry_u16 A July 19, 2020, 9:56 a.m. OK Mono C# TESTS 6 155 11673600 1500
87321583 flu2 A July 19, 2020, 10:14 a.m. OK Mono C# TESTS 6 498 15462400 1500
87318868 theweird A July 19, 2020, 10:08 a.m. OK MS C++ TESTS 6 31 4096000 1500
87334863 Loesen A July 19, 2020, 10:44 a.m. OK MS C++ TESTS 6 46 4096000 1500
87341821 areo A July 19, 2020, 10:58 a.m. OK MS C++ 2017 TESTS 6 31 3686400 1500
87331580 grimkel A July 19, 2020, 10:37 a.m. OK MS C++ 2017 TESTS 6 31 3788800 1500
87311584 lhs8928 A July 19, 2020, 9:53 a.m. OK MS C++ 2017 TESTS 6 46 3686400 1500
87366966 spade26262626 A July 19, 2020, 3:22 p.m. OK MS C++ 2017 TESTS 6 46 3686400 1500
87334179 akulinich A July 19, 2020, 10:43 a.m. OK MS C++ 2017 TESTS 6 46 3788800 1500
87311933 FarmerThy A July 19, 2020, 9:54 a.m. OK MS C++ 2017 TESTS 6 46 3993600 1500
87398111 pjh6792 A July 20, 2020, 4:47 a.m. OK MS C++ 2017 TESTS 7 46 3993600 1500
87353260 little_lion A July 19, 2020, 12:52 p.m. OK MS C++ 2017 TESTS 6 61 3686400 1500
87329534 Tuenjuko A July 19, 2020, 10:32 a.m. OK MS C++ 2017 TESTS 6 61 3686400 1500
87340965 magicfish A July 19, 2020, 10:57 a.m. OK MS C++ 2017 TESTS 6 61 3686400 1500
87340301 39dll A July 19, 2020, 10:56 a.m. OK PyPy 2 TESTS 6 265 29696000 1500
87344973 yamatoumi A July 19, 2020, 11:38 a.m. OK PyPy 2 TESTS 6 296 28979200 1500
87316945 Pyar.Mahobat.Dhoka.Hai A July 19, 2020, 10:04 a.m. OK PyPy 2 TESTS 6 342 29900800 1500
87344741 drd93 A July 19, 2020, 11:36 a.m. OK PyPy 2 TESTS 6 342 32972800 1500
87313409 Mukundan314 A July 19, 2020, 9:57 a.m. OK PyPy 2 TESTS 6 389 30822400 1500
87333066 MVP A July 19, 2020, 10:40 a.m. OK PyPy 2 TESTS 6 623 31948800 1500
87345713 cyhan A July 19, 2020, 11:43 a.m. OK PyPy 3 TESTS 6 218 26726400 1500
87312284 yashwant_singh A July 19, 2020, 9:55 a.m. OK PyPy 3 TESTS 6 233 25600000 1500
87353883 kamojiro A July 19, 2020, 12:58 p.m. OK PyPy 3 TESTS 6 233 26112000 1500
87386456 titia A July 19, 2020, 9:42 p.m. OK PyPy 3 TESTS 7 233 26521600 1500
87345665 itsbhavya A July 19, 2020, 11:42 a.m. OK PyPy 3 TESTS 6 249 26214400 1500
87361623 cgfs10000 A July 19, 2020, 2:23 p.m. OK PyPy 3 TESTS 6 249 27443200 1500
87333084 tiwari0000 A July 19, 2020, 10:40 a.m. OK PyPy 3 TESTS 6 264 26316800 1500
87347666 rishabhrathi22 A July 19, 2020, 11:58 a.m. OK PyPy 3 TESTS 6 264 26419200 1500
87347581 Long_time_no_C A July 19, 2020, 11:57 a.m. OK PyPy 3 TESTS 6 264 26419200 1500
87315350 KA_Rma A July 19, 2020, 10:01 a.m. OK PyPy 3 TESTS 6 264 26828800 1500
87370126 Ekinak A July 19, 2020, 4:01 p.m. OK Python 2 TESTS 6 280 6553600 1500
87354333 eugalt A July 19, 2020, 1:03 p.m. OK Python 3 TESTS 6 155 7987200 1500
87347922 eugalt A July 19, 2020, noon OK Python 3 TESTS 6 170 8089600 1500
87397269 eugalt A July 20, 2020, 4:20 a.m. OK Python 3 TESTS 7 171 7987200 1500
87394622 eugalt A July 20, 2020, 3:07 a.m. OK Python 3 TESTS 7 171 7987200 1500
87354857 eugalt A July 19, 2020, 1:09 p.m. OK Python 3 TESTS 6 171 7987200 1500
87363442 utshab1618 A July 19, 2020, 2:42 p.m. OK Python 3 TESTS 6 202 6963200 1500
87369697 rummansadik A July 19, 2020, 3:55 p.m. OK Python 3 TESTS 6 217 6963200 1500
87377868 LintuStorm A July 19, 2020, 6:10 p.m. OK Python 3 TESTS 7 218 6963200 1500
87345050 niyati_ag A July 19, 2020, 11:38 a.m. OK Python 3 TESTS 6 218 6963200 1500
87312188 msh_shiplu A July 19, 2020, 9:54 a.m. OK Python 3 TESTS 6 218 6963200 1500
87358678 komorin95 A July 19, 2020, 1:51 p.m. OK Rust TESTS 6 31 4300800 1500
87356608 komorin95 A July 19, 2020, 1:30 p.m. OK Rust TESTS 6 31 4300800 1500
87323562 komorin95 A July 19, 2020, 10:18 a.m. OK Rust TESTS 6 46 4300800 1500
87399963 bqn A July 20, 2020, 5:30 a.m. OK Rust TESTS 7 124 4096000 1500
87356974 terraformer A July 19, 2020, 1:33 p.m. OK Rust TESTS 6 140 3788800 1500
87374999 IvanDyachenko A July 19, 2020, 5:20 p.m. OK Scala TESTS 7 748 40652800 1500
87374685 IvanDyachenko A July 19, 2020, 5:14 p.m. OK Scala TESTS 7 919 40960000 1500

remove filters

Back to search problems