Codeforces Round 606 (Div. 2, based on Technocup 2020 Elimination Round 4)

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
1277 Codeforces Round 606 (Div. 2, based on Technocup 2020 Elimination Round 4) FINISHED False 7200 155501699 Dec. 14, 2019, 11:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3129 ) D Let's Play the Words? PROGRAMMING data structures hashing implementation math 1800

B'Polycarp has n different binary words. A word called binary if it contains only characters '0 ' and '1 '. For example, these words are binary: "0001", "11", "0" and "0011100". Polycarp wants to offer his set of n binary words to play a game "words". In this game, players name words and each next word (starting from the second) must start with the last character of the previous word. The first word can be any. For example, these sequence of words can be named during the game: "0101", "1", "10", "00", "00001". Word reversal is the operation of reversing the order of the characters. For example, the word "0111" after the reversal becomes "1110", the word "11010" after the reversal becomes "01011". Probably, Polycarp has such a set of words that there is no way to put them in the order correspondent to the game rules. In this situation, he wants to reverse some words from his set so that: Polycarp wants to reverse minimal number of words. Please, help him. The first line of the input contains one integer t ( 1 <= t <= 10^4 ) -- the number of test cases in the input. Then t test cases follow. The first line of a test case contains one integer n ( 1 <= n <= 2 cdot10^5 ) -- the number of words in the Polycarp 's set. Next n lines contain these words. All of n words aren 't empty and contains only characters '0 ' and '1 '. The sum of word lengths doesn 't exceed 4 cdot10^6 . All words are different. Guaranteed, that the sum of n for all test cases in the input doesn 't exceed 2 cdot10^5 . Also, guaranteed that the sum of word lengths for all test cases in the input doesn 't exceed 4 cdot10^6 . Print answer for all of t test cases in the order they appear. If there is no answer for the test case, print -1. Otherwise, the first line of the output should contain k ( 0 <= k <= n ) -- the minimal number of words in the set which should be reversed. The second line of the output shoul'...

Tutorials

Technocup 2020 — Elimination Round 4 + Codeforces Round 606: Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
66990416 LaSWeeG D Dec. 15, 2019, 8:04 p.m. OK FPC TESTS 44 1325 31744000 1800
67055698 singerl D Dec. 17, 2019, 6:44 a.m. OK GNU C11 TESTS 44 2074 9420800 1800
66860516 Coming D Dec. 14, 2019, 12:32 p.m. OK GNU C++11 TESTS 44 124 53760000 1800
66931292 shaojianan D Dec. 15, 2019, 7:31 a.m. OK GNU C++11 TESTS 44 124 54988800 1800
66861520 Rikuki D Dec. 14, 2019, 12:36 p.m. OK GNU C++11 TESTS 44 124 102195200 1800
66916436 zzy2005 D Dec. 15, 2019, 6:03 a.m. OK GNU C++11 TESTS 44 124 136294400 1800
66869242 EnderBracket D Dec. 14, 2019, 1:04 p.m. OK GNU C++11 TESTS 44 139 53350400 1800
66865104 443singer D Dec. 14, 2019, 12:50 p.m. OK GNU C++11 TESTS 44 140 88166400 1800
66855405 goodbye_chenjb D Dec. 14, 2019, 12:12 p.m. OK GNU C++11 TESTS 44 140 103936000 1800
66896091 UoU D Dec. 15, 2019, 1:52 a.m. OK GNU C++11 TESTS 44 155 17715200 1800
66861723 indogent D Dec. 14, 2019, 12:37 p.m. OK GNU C++11 TESTS 44 155 46182400 1800
67185444 sanchezIII D Dec. 19, 2019, 4:15 a.m. OK GNU C++11 TESTS 44 156 45260800 1800
67979541 DMCS D Dec. 30, 2019, 6:31 p.m. OK GNU C++14 TESTS 47 109 63078400 1800
66859888 theStaticMind D Dec. 14, 2019, 12:29 p.m. OK GNU C++14 TESTS 44 156 22016000 1800
66862564 ljupche98 D Dec. 14, 2019, 12:40 p.m. OK GNU C++14 TESTS 44 156 22016000 1800
66993976 PauloMiranda98 D Dec. 15, 2019, 10:49 p.m. OK GNU C++14 TESTS 44 171 23142400 1800
66876671 Orz_c---8 D Dec. 14, 2019, 3:10 p.m. OK GNU C++14 TESTS 44 186 16384000 1800
66883512 pranet D Dec. 14, 2019, 5:24 p.m. OK GNU C++14 TESTS 44 187 7782400 1800
67031960 neo203 D Dec. 16, 2019, 4:07 p.m. OK GNU C++14 TESTS 44 187 18227200 1800
66860718 philologist D Dec. 14, 2019, 12:33 p.m. OK GNU C++14 TESTS 44 187 62259200 1800
66883345 pranet D Dec. 14, 2019, 5:20 p.m. OK GNU C++14 TESTS 44 202 7782400 1800
66856303 baranwalm D Dec. 14, 2019, 12:16 p.m. OK GNU C++14 TESTS 44 202 19763200 1800
66847504 FuruyaRei D Dec. 14, 2019, 11:47 a.m. OK GNU C++17 TESTS 44 124 21299200 1800
66860068 qujing.kukyo D Dec. 14, 2019, 12:30 p.m. OK GNU C++17 TESTS 44 124 135987200 1800
67132633 szechuan_sauce D Dec. 18, 2019, 1:24 a.m. OK GNU C++17 TESTS 44 140 13414400 1800
66859941 zaher__ D Dec. 14, 2019, 12:30 p.m. OK GNU C++17 TESTS 44 140 20275200 1800
66899634 cx991011 D Dec. 15, 2019, 4:42 a.m. OK GNU C++17 TESTS 44 140 50380800 1800
66865345 hiddenStudent D Dec. 14, 2019, 12:51 p.m. OK GNU C++17 TESTS 44 155 62771200 1800
66858688 rzy_97 D Dec. 14, 2019, 12:25 p.m. OK GNU C++17 TESTS 44 155 76083200 1800
66854424 Yzm007 D Dec. 14, 2019, 12:09 p.m. OK GNU C++17 TESTS 44 155 107110400 1800
66868331 pubfso D Dec. 14, 2019, 1:02 p.m. OK GNU C++17 TESTS 44 156 168448000 1800
66993759 Not-Afraid D Dec. 15, 2019, 10:35 p.m. OK GNU C++17 TESTS 44 170 32256000 1800
66885183 serafimkoo D Dec. 14, 2019, 5:58 p.m. OK Java 11 TESTS 44 467 29900800 1800
66892914 TheSawan D Dec. 14, 2019, 10 p.m. OK Java 11 TESTS 44 483 34099200 1800
67167270 Anonymous D Dec. 18, 2019, 3:59 p.m. OK Java 11 TESTS 44 514 36659200 1800
67443588 machhra D Dec. 22, 2019, 8:38 p.m. OK Java 11 TESTS 47 530 36761600 1800
66856951 jjluczyn D Dec. 14, 2019, 12:18 p.m. OK Java 11 TESTS 44 592 35737600 1800
68055090 adamjamil D Jan. 1, 2020, 9:46 p.m. OK Java 11 TESTS 47 857 34304000 1800
66859812 al_Jahy D Dec. 14, 2019, 12:29 p.m. OK Java 11 TESTS 44 920 31334400 1800
67193236 potatmen D Dec. 19, 2019, 7:59 a.m. OK Java 11 TESTS 44 1201 69324800 1800
66985696 ShesMyNerd D Dec. 15, 2019, 6 p.m. OK Java 11 TESTS 44 1528 48230400 1800
68102456 4mda4mda D Jan. 3, 2020, 4:34 a.m. OK Java 8 TESTS 47 249 102912000 1800
66991252 MagentaCobra D Dec. 15, 2019, 8:33 p.m. OK Java 8 TESTS 44 327 36352000 1800
66890974 YahiaSherif D Dec. 14, 2019, 8:31 p.m. OK Java 8 TESTS 44 358 34099200 1800
67187450 af_saif D Dec. 19, 2019, 5:33 a.m. OK Java 8 TESTS 44 389 38604800 1800
68162517 wretar D Jan. 4, 2020, 11:31 a.m. OK Java 8 TESTS 47 389 39116800 1800
66847516 DanielW48 D Dec. 14, 2019, 11:47 a.m. OK Java 8 TESTS 44 405 35123200 1800
67184109 yaoct D Dec. 19, 2019, 3:05 a.m. OK Java 8 TESTS 44 405 36249600 1800
67516111 ZeyadKhattab D Dec. 24, 2019, 10:54 a.m. OK Java 8 TESTS 47 405 38604800 1800
66893550 Agnimandur D Dec. 14, 2019, 10:39 p.m. OK Java 8 TESTS 44 405 39321600 1800
66864288 PDDMain D Dec. 14, 2019, 12:47 p.m. OK Java 8 TESTS 44 405 39321600 1800
67472520 Spheniscine D Dec. 23, 2019, 1:16 p.m. OK Kotlin TESTS 47 420 38912000 1800
67472706 Spheniscine D Dec. 23, 2019, 1:19 p.m. OK Kotlin TESTS 47 436 38604800 1800
67472897 Spheniscine D Dec. 23, 2019, 1:23 p.m. OK Kotlin TESTS 47 530 35328000 1800
67060329 hcmdgh D Dec. 17, 2019, 8:46 a.m. OK Kotlin TESTS 44 795 55808000 1800
66897272 csgo D Dec. 15, 2019, 2:51 a.m. OK Mono C# TESTS 44 280 64921600 1800
67158170 hyzhangzhy D Dec. 18, 2019, 1:08 p.m. OK Mono C# TESTS 44 342 34099200 1800
66854240 csgo D Dec. 14, 2019, 12:08 p.m. OK Mono C# TESTS 44 373 63590400 1800
66848918 tomomo2b2 D Dec. 14, 2019, 11:52 a.m. OK Mono C# TESTS 44 577 31027200 1800
66863498 sergmel D Dec. 14, 2019, 12:44 p.m. OK Mono C# TESTS 44 592 40345600 1800
66867939 eki D Dec. 14, 2019, 1 p.m. OK Mono C# TESTS 44 685 29798400 1800
66893934 csgo D Dec. 14, 2019, 11:07 p.m. OK Mono C# TESTS 44 873 63283200 1800
66873936 hibatibati D Dec. 14, 2019, 2:24 p.m. OK Mono C# TESTS 44 2963 76288000 1800
67449843 Gleb_Dubosarskii D Dec. 23, 2019, 3:04 a.m. OK MS C++ TESTS 47 343 22835200 1800
66980414 Still_Theory D Dec. 15, 2019, 4:11 p.m. OK MS C++ 2017 TESTS 44 233 19148800 1800
66864303 youx D Dec. 14, 2019, 12:47 p.m. OK MS C++ 2017 TESTS 44 264 29081600 1800
66876464 TAImatem D Dec. 14, 2019, 3:06 p.m. OK MS C++ 2017 TESTS 44 280 20992000 1800
66971018 efyjef D Dec. 15, 2019, 1:12 p.m. OK MS C++ 2017 TESTS 44 343 20480000 1800
66848610 Kniaz D Dec. 14, 2019, 11:51 a.m. OK MS C++ 2017 TESTS 44 404 10035200 1800
67316656 llFreetimell D Dec. 21, 2019, 6:20 a.m. OK MS C++ 2017 TESTS 44 499 23859200 1800
66861480 c.u D Dec. 14, 2019, 12:36 p.m. OK MS C++ 2017 TESTS 44 514 30515200 1800
66852823 Prokopiy D Dec. 14, 2019, 12:03 p.m. OK MS C++ 2017 TESTS 44 545 20582400 1800
67986013 CygneNoir D Dec. 30, 2019, 10:46 p.m. OK MS C++ 2017 TESTS 47 607 49152000 1800
67075743 Vanster D Dec. 17, 2019, 2:23 p.m. OK MS C++ 2017 TESTS 44 623 32051200 1800
66850065 zdbtxdy D Dec. 14, 2019, 11:55 a.m. OK PyPy 2 TESTS 44 312 27852800 1800
67076595 yumtam D Dec. 17, 2019, 2:41 p.m. OK PyPy 2 TESTS 44 420 27238400 1800
66899560 idgaf D Dec. 15, 2019, 4:38 a.m. OK PyPy 2 TESTS 44 1232 19456000 1800
69152485 aberent D Jan. 19, 2020, 6:06 p.m. OK PyPy 3 TESTS 47 608 29491200 1800
66857033 ngsm D Dec. 14, 2019, 12:18 p.m. OK PyPy 3 TESTS 44 624 36044800 1800
69187188 bash D Jan. 20, 2020, 12:21 p.m. OK PyPy 3 TESTS 47 638 36044800 1800
66857634 auouo D Dec. 14, 2019, 12:21 p.m. OK PyPy 3 TESTS 44 670 24064000 1800
66863165 cgfs10000 D Dec. 14, 2019, 12:42 p.m. OK PyPy 3 TESTS 44 670 32256000 1800
68119162 xiema D Jan. 3, 2020, 12:37 p.m. OK PyPy 3 TESTS 47 670 41779200 1800
66859152 Coki628 D Dec. 14, 2019, 12:26 p.m. OK PyPy 3 TESTS 44 686 28774400 1800
66863159 wattaihei D Dec. 14, 2019, 12:42 p.m. OK PyPy 3 TESTS 44 686 43622400 1800
66863141 cftt D Dec. 14, 2019, 12:42 p.m. OK PyPy 3 TESTS 44 779 39833600 1800
66855131 syphon D Dec. 14, 2019, 12:11 p.m. OK PyPy 3 TESTS 44 811 59392000 1800
66970595 sruthi_1729 D Dec. 15, 2019, 1:05 p.m. OK Python 2 TESTS 44 530 23142400 1800
66974153 NocturneBflat D Dec. 15, 2019, 2:06 p.m. OK Python 3 TESTS 44 577 25395200 1800
66872862 3x7 D Dec. 14, 2019, 2:08 p.m. OK Python 3 TESTS 44 670 27545600 1800
66863210 3x7 D Dec. 14, 2019, 12:43 p.m. OK Python 3 TESTS 44 685 26521600 1800

remove filters

Back to search problems