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.
Problems
B"BerSoft is the biggest IT corporation in Berland, and Monocarp is the head of its security department. This time, he faced the most difficult task ever. Basically, there are n developers working at BerSoft, numbered from 1 to n . There are m documents shared on the internal network, numbered from 1 to m . There is a table of access requirements a such that a_{i,j} (the j -th element of the i -th row) is 1 if the i -th developer should have access to the j -th document, and 0 if they should have no access to it. In order to restrict the access, Monocarp is going to perform the following actions: The developer i has access to the document j if their access level for the access group of the document is greater than or equal to the required access level of the document. What's the smallest number of access groups Monocarp can choose so that it's possible to assign access groups and access levels in order to satisfy the table of access requirements? The first line contains two integers n and m ( 1 <= n, m <= 500 ) -- the number of developers and the number of documents. Each of the next n lines contains a binary string of length m -- the table of access requirements. The j -th element of the i -th row is 1 if the i -th developer should have access to the j -th document, and 0 if they should have no access to it. The first line should contain a single integer k -- the smallest number of access groups Monocarp can choose so that it's possible to assign access groups and access levels in order to satisfy the table of access requirements. The second line should contain m integers from 1 to k -- the access groups of the documents. The third line should contain m integers from 1 to 10^9 -- the required access levels of the documents. The i -th of the next n"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
182905192 |
Heibor CodigoL reedef |
A |
Nov. 27, 2022, 12:56 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
46 |
1331200 |
|
2400 |
182917044 |
dreamoon_love_AA A_A_ |
A |
Nov. 27, 2022, 2:28 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
62 |
46489600 |
|
2400 |
182946150 |
mahmoudkhalid112 |
A |
Nov. 27, 2022, 7:51 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
93 |
2355200 |
|
2400 |
182908664 |
chaihf SGColin ZigZagK |
A |
Nov. 27, 2022, 1:22 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
109 |
2867200 |
|
2400 |
182819274 |
Imdie cxm1024 Zeardoe |
A |
Nov. 27, 2022, 11:52 a.m. |
OK |
GNU C++14 |
TESTS |
85 |
155 |
4300800 |
|
2400 |
182933516 |
SpringWait |
A |
Nov. 27, 2022, 5:03 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
156 |
3174400 |
|
2400 |
182889420 |
wanghaoze CHENRUIJIE |
A |
Nov. 27, 2022, 12:07 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
202 |
29388800 |
|
2400 |
182932151 |
omeganot |
A |
Nov. 27, 2022, 4:48 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
249 |
1740800 |
|
2400 |
182905926 |
Jimanbanashi |
A |
Nov. 27, 2022, 1:01 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
264 |
2252800 |
|
2400 |
182970474 |
gqh |
A |
Nov. 28, 2022, 5:35 a.m. |
OK |
GNU C++14 |
TESTS |
85 |
436 |
27852800 |
|
2400 |
182916830 |
Vladik vilcheuski |
A |
Nov. 27, 2022, 2:26 p.m. |
OK |
GNU C++17 |
TESTS |
85 |
46 |
5017600 |
|
2400 |
182918851 |
dragoon Alpha_Q |
A |
Nov. 27, 2022, 2:44 p.m. |
OK |
GNU C++17 |
TESTS |
85 |
46 |
6860800 |
|
2400 |
182960069 |
MatheusLealV |
A |
Nov. 28, 2022, 1:31 a.m. |
OK |
GNU C++17 |
TESTS |
85 |
62 |
4198400 |
|
2400 |
182910115 |
xuanquang1999 6aren chemthan |
A |
Nov. 27, 2022, 1:33 p.m. |
OK |
GNU C++17 |
TESTS |
85 |
62 |
43110400 |
|
2400 |
182924006 |
luckyyou rabbyte _tth37 |
A |
Nov. 27, 2022, 3:30 p.m. |
OK |
GNU C++17 |
TESTS |
85 |
77 |
5017600 |
|
2400 |
182966832 |
Believer_112 |
A |
Nov. 28, 2022, 4:18 a.m. |
OK |
GNU C++17 |
TESTS |
85 |
93 |
307200 |
|
2400 |
182904642 |
fanache99 |
A |
Nov. 27, 2022, 12:52 p.m. |
OK |
GNU C++17 |
TESTS |
85 |
93 |
1638400 |
|
2400 |
182919473 |
fallleaves01 sleep__ |
A |
Nov. 27, 2022, 2:49 p.m. |
OK |
GNU C++17 |
TESTS |
85 |
93 |
5120000 |
|
2400 |
182966856 |
Believer_112 |
A |
Nov. 28, 2022, 4:19 a.m. |
OK |
GNU C++17 |
TESTS |
85 |
109 |
307200 |
|
2400 |
182966853 |
Believer_112 |
A |
Nov. 28, 2022, 4:19 a.m. |
OK |
GNU C++17 |
TESTS |
85 |
109 |
307200 |
|
2400 |
182899281 |
cuiaoxiang |
A |
Nov. 27, 2022, 12:14 p.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
46 |
1638400 |
|
2400 |
182950644 |
Karuna |
A |
Nov. 27, 2022, 9:07 p.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
46 |
2048000 |
|
2400 |
182904289 |
Karuna jhhope1 L0TUS |
A |
Nov. 27, 2022, 12:49 p.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
46 |
2048000 |
|
2400 |
182903754 |
YaoBIG kimoyami |
A |
Nov. 27, 2022, 12:45 p.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
46 |
2560000 |
|
2400 |
182919709 |
Toxel |
A |
Nov. 27, 2022, 2:51 p.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
46 |
3072000 |
|
2400 |
182768675 |
kotatsugame |
A |
Nov. 27, 2022, 11 a.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
46 |
3993600 |
|
2400 |
182914355 |
troqui064 |
A |
Nov. 27, 2022, 2:07 p.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
93 |
27852800 |
|
2400 |
182919620 |
Bolshevik |
A |
Nov. 27, 2022, 2:50 p.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
109 |
2355200 |
|
2400 |
182901789 |
bensonlzl dvdg6566 esleong |
A |
Nov. 27, 2022, 12:31 p.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
124 |
3891200 |
|
2400 |
182906838 |
mcdx9524 Andreasyan |
A |
Nov. 27, 2022, 1:08 p.m. |
OK |
GNU C++17 (64) |
TESTS |
85 |
155 |
14233600 |
|
2400 |
182916907 |
denis2111 vladvlad00 status_coding |
A |
Nov. 27, 2022, 2:27 p.m. |
OK |
GNU C++20 (64) |
TESTS |
85 |
31 |
1024000 |
|
2400 |
182910429 |
NoSteam909 BdE TheCrawfish |
A |
Nov. 27, 2022, 1:36 p.m. |
OK |
GNU C++20 (64) |
TESTS |
85 |
31 |
1126400 |
|
2400 |
182903311 |
down LucaSeri IntoTheNight |
A |
Nov. 27, 2022, 12:42 p.m. |
OK |
GNU C++20 (64) |
TESTS |
85 |
31 |
1228800 |
|
2400 |
182902224 |
pachico mtsd |
A |
Nov. 27, 2022, 12:34 p.m. |
OK |
GNU C++20 (64) |
TESTS |
85 |
31 |
1536000 |
|
2400 |
182908692 |
wnmrmr nathan_luiz |
A |
Nov. 27, 2022, 1:23 p.m. |
OK |
GNU C++20 (64) |
TESTS |
85 |
31 |
3788800 |
|
2400 |
182848690 |
353cerega Batrr |
A |
Nov. 27, 2022, 11:58 a.m. |
OK |
GNU C++20 (64) |
TESTS |
85 |
46 |
819200 |
|
2400 |
182929971 |
Sa3tElSefr |
A |
Nov. 27, 2022, 4:26 p.m. |
OK |
GNU C++20 (64) |
TESTS |
85 |
46 |
1228800 |
|
2400 |
182922224 |
Sa3tElSefr |
A |
Nov. 27, 2022, 3:14 p.m. |
OK |
GNU C++20 (64) |
TESTS |
85 |
46 |
1228800 |
|
2400 |
182848710 |
tfg |
A |
Nov. 27, 2022, 11:58 a.m. |
OK |
GNU C++20 (64) |
TESTS |
85 |
46 |
4505600 |
|
2400 |
182849213 |
Gary2005 platelet LZDQ |
A |
Nov. 27, 2022, noon |
OK |
GNU C++20 (64) |
TESTS |
85 |
61 |
12185600 |
|
2400 |
182916371 |
knightL |
A |
Nov. 27, 2022, 2:23 p.m. |
OK |
Java 11 |
TESTS |
85 |
592 |
0 |
|
2400 |
182880340 |
arvindf232 |
A |
Nov. 27, 2022, 12:06 p.m. |
OK |
Kotlin 1.6 |
TESTS |
85 |
811 |
2048000 |
|
2400 |
182909268 |
ArtyomTsepov reshke Friska |
A |
Nov. 27, 2022, 1:27 p.m. |
OK |
MS C++ 2017 |
TESTS |
85 |
171 |
4096000 |
|
2400 |
182918374 |
SophieHatter ttmred |
A |
Nov. 27, 2022, 2:40 p.m. |
OK |
PyPy 3-64 |
TESTS |
85 |
202 |
12902400 |
|
2400 |
182903175 |
Egor |
A |
Nov. 27, 2022, 12:41 p.m. |
OK |
Rust 2021 |
TESTS |
85 |
46 |
6656000 |
|
2400 |
remove filters
Back to search problems