Codeforces Round 948 (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
1977 Codeforces Round 948 (Div. 2) FINISHED False 7200 20445863 May 26, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1955 ) D XORificator PROGRAMMING bitmasks brute force greedy hashing 2300

B"You are given a binary (consisting only of 0s and 1s) n x m matrix. You are also given a XORificator, using which you can invert all the values in a chosen row (i.e. replace 0 with 1 and 1 with 0). A column in the matrix is considered special if it contains exactly one 1. Your task is to find the maximum number of columns that can be made special at the same time, and the set of rows the XORificator should be used on to achieve that. Each test contains multiple test cases. The first line of input contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two integers n and m ( 1 <= q n, m <= q 3 cdot 10^5 , n cdot m <= q 3 cdot 10^5 ). Each of the following n lines of the test case contains a binary string of length m . It is guaranteed that the sum of n cdot m over all test cases does not exceed 3 cdot 10^5 . For each test case, output two lines. In the first line, output the maximum number of special columns that is possible to get simultaneously. In the second line, output a binary string of length n , where the i -th character is 0, if you don't use the XORificator on the i -th row, and 1, if you use the XORificator on the i -th row. If there are multiple valid XORificator configurations that achieve the optimal answer, you can output any of them. In the first test case, you can use the XORificator on the second row to make the columns 2 , 3 , and 4 special. In the second test case, the only column is already special, so you don't need to use the XORificator. "...

Tutorials

129858

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
263233201 szcQAQ D May 30, 2024, 11:51 a.m. OK C++14 (GCC 6-32) TESTS 46 264 19763200 2300
263397203 gan1234 D May 31, 2024, 1:29 a.m. OK C++14 (GCC 6-32) TESTS 46 265 19456000 2300
263191058 selmon__bhoi D May 29, 2024, 11:36 p.m. OK C++14 (GCC 6-32) TESTS 46 280 18534400 2300
263233536 szcQAQ D May 30, 2024, 11:53 a.m. OK C++14 (GCC 6-32) TESTS 46 280 19865600 2300
263397224 gan1234 D May 31, 2024, 1:29 a.m. OK C++14 (GCC 6-32) TESTS 46 281 19456000 2300
263086135 TRYING_To_Do_Better__ D May 29, 2024, 4:41 a.m. OK C++14 (GCC 6-32) TESTS 46 296 18636800 2300
263607619 hgckythgcfhk D June 1, 2024, 9:39 a.m. OK C++14 (GCC 6-32) TESTS 46 311 38912000 2300
263199331 gan1234 D May 30, 2024, 4:47 a.m. OK C++14 (GCC 6-32) TESTS 46 312 19353600 2300
263260372 Mr_rick D May 30, 2024, 2:04 p.m. OK C++14 (GCC 6-32) TESTS 46 312 25088000 2300
263114521 Yoralen D May 29, 2024, 8:55 a.m. OK C++14 (GCC 6-32) TESTS 46 327 15257600 2300
263109908 quangvinh2352 D May 29, 2024, 8:17 a.m. OK C++17 (GCC 7-32) TESTS 46 109 10752000 2300
263054558 Mohamedtarekfayez D May 28, 2024, 6:42 p.m. OK C++17 (GCC 7-32) TESTS 46 124 10752000 2300
263230000 knightzzz1 D May 30, 2024, 11:28 a.m. OK C++17 (GCC 7-32) TESTS 46 124 19660800 2300
263153578 ahshafi D May 29, 2024, 2:09 p.m. OK C++17 (GCC 7-32) TESTS 46 124 20480000 2300
263445585 LeDaiKing D May 31, 2024, 10:05 a.m. OK C++17 (GCC 7-32) TESTS 46 187 22937600 2300
263141722 cyb1010 D May 29, 2024, 12:38 p.m. OK C++17 (GCC 7-32) TESTS 46 202 18432000 2300
263141768 cyb1010 D May 29, 2024, 12:39 p.m. OK C++17 (GCC 7-32) TESTS 46 203 18432000 2300
263141513 cyb1010 D May 29, 2024, 12:37 p.m. OK C++17 (GCC 7-32) TESTS 46 233 18432000 2300
263145968 mikyoch D May 29, 2024, 1:12 p.m. OK C++17 (GCC 7-32) TESTS 46 233 18636800 2300
263257580 Rudraksh D May 30, 2024, 1:42 p.m. OK C++17 (GCC 7-32) TESTS 46 233 18739200 2300
263046194 xiaoyuMUA D May 28, 2024, 5:25 p.m. OK C++20 (GCC 13-64) TESTS 46 109 28876800 2300
263165989 KJJD D May 29, 2024, 4:01 p.m. OK C++20 (GCC 13-64) TESTS 46 109 44544000 2300
262984977 MisterReaper D May 28, 2024, 8:59 a.m. OK C++20 (GCC 13-64) TESTS 46 124 11264000 2300
262984887 MisterReaper D May 28, 2024, 8:58 a.m. OK C++20 (GCC 13-64) TESTS 46 140 11264000 2300
263696017 I_Love_Homura D June 2, 2024, 3:44 a.m. OK C++20 (GCC 13-64) TESTS 47 171 20992000 2300
263251073 A_cat_with_a_hat D May 30, 2024, 12:54 p.m. OK C++20 (GCC 13-64) TESTS 46 171 35123200 2300
263043675 huanixel D May 28, 2024, 5:01 p.m. OK C++20 (GCC 13-64) TESTS 46 171 37068800 2300
263018383 TheRedStone D May 28, 2024, 1:34 p.m. OK C++20 (GCC 13-64) TESTS 46 171 176332800 2300
263164442 KJJD D May 29, 2024, 3:46 p.m. OK C++20 (GCC 13-64) TESTS 46 186 22016000 2300
263425889 Inkyo D May 31, 2024, 7:01 a.m. OK C++20 (GCC 13-64) TESTS 46 186 24576000 2300
263203603 79209748 D May 30, 2024, 6:01 a.m. OK Go TESTS 46 171 41984000 2300
263643773 nguyenquocthao00 D June 1, 2024, 2:39 p.m. OK Go TESTS 46 218 55193600 2300
263445044 saubhagyat_ug_22 D May 31, 2024, 9:58 a.m. OK Java 21 TESTS 46 687 57446400 2300
262987214 yang_wei D May 28, 2024, 9:18 a.m. OK Java 21 TESTS 46 796 76595200 2300
262954290 man-ray D May 28, 2024, 4:17 a.m. OK Java 21 TESTS 46 842 39731200 2300
262981250 yang_wei D May 28, 2024, 8:27 a.m. OK Java 21 TESTS 46 921 72806400 2300
263617949 2100031768cse D June 1, 2024, 11:04 a.m. OK Java 21 TESTS 46 984 73318400 2300
263232080 Dheerajjha D May 30, 2024, 11:42 a.m. OK Java 21 TESTS 46 999 72908800 2300
263530503 duyipeng D May 31, 2024, 5:06 p.m. OK Java 21 TESTS 46 1061 75571200 2300
263019159 yvbf D May 28, 2024, 1:41 p.m. OK Java 8 TESTS 46 718 66048000 2300
263113529 1091857051 D May 29, 2024, 8:47 a.m. OK Java 8 TESTS 46 1015 57651200 2300
262965701 chinatest D May 28, 2024, 6:12 a.m. OK Java 8 TESTS 46 1062 52121600 2300
262972602 Naomi00 D May 28, 2024, 7:14 a.m. OK PyPy 2 TESTS 46 1139 106598400 2300
263049358 strashila D May 28, 2024, 5:53 p.m. OK PyPy 3-64 TESTS 46 452 99225600 2300
263281800 endlessSecond D May 30, 2024, 2:47 p.m. OK PyPy 3-64 TESTS 46 625 93593600 2300
262980656 Synaptic_Savant D May 28, 2024, 8:22 a.m. OK PyPy 3-64 TESTS 46 671 90521600 2300
263138597 Rumors D May 29, 2024, 12:14 p.m. OK PyPy 3-64 TESTS 46 702 118886400 2300
263583970 MAO1112 D June 1, 2024, 6:25 a.m. OK PyPy 3-64 TESTS 46 734 101580800 2300
263073528 liupengsay D May 29, 2024, 12:43 a.m. OK PyPy 3-64 TESTS 46 859 162713600 2300
263012340 jgs03177 D May 28, 2024, 12:47 p.m. OK PyPy 3-64 TESTS 46 874 145305600 2300
263630901 shubham6105 D June 1, 2024, 12:47 p.m. OK PyPy 3-64 TESTS 46 905 81612800 2300
263202514 Little_Sheep_Yawn D May 30, 2024, 5:43 a.m. OK PyPy 3-64 TESTS 46 905 141926400 2300
263073362 _Kee D May 29, 2024, 12:38 a.m. OK PyPy 3-64 TESTS 46 905 153702400 2300
263217109 Sergey18 D May 30, 2024, 9:32 a.m. OK Python 2 TESTS 46 1499 56627200 2300
263428856 endlessSecond D May 31, 2024, 7:25 a.m. OK Python 3 TESTS 46 562 44441600 2300
263056004 tarqulalamopi D May 28, 2024, 6:58 p.m. OK Python 3 TESTS 46 1109 99430400 2300
263258150 tarqulalamopi D May 30, 2024, 1:47 p.m. OK Python 3 TESTS 46 1155 99532800 2300
262953810 liut D May 28, 2024, 4:11 a.m. OK Rust 2021 TESTS 46 140 24985600 2300
263207389 BetterThanNobita D May 30, 2024, 7:04 a.m. OK Rust 2021 TESTS 46 140 33792000 2300
263051088 bqn D May 28, 2024, 6:09 p.m. OK Rust 2021 TESTS 46 358 104960000 2300
263000222 0npata D May 28, 2024, 11:10 a.m. OK Rust 2021 TESTS 46 406 23552000 2300

remove filters

Back to search problems