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 |
---|---|---|---|---|---|---|
1622 | Educational Codeforces Round 120 (Rated for Div. 2) | FINISHED | False | 7200 | 91207499 | Dec. 27, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1912 ) | E | Math Test | PROGRAMMING | bitmasks brute force greedy |
B'Petya is a math teacher. n of his students has written a test consisting of m questions. For each student, it is known which questions he has answered correctly and which he has not. If the student answers the j -th question correctly, he gets p_j points (otherwise, he gets 0 points). Moreover, the points for the questions are distributed in such a way that the array p is a permutation of numbers from 1 to m . For the i -th student, Petya knows that he expects to get x_i points for the test. Petya wonders how unexpected the results could be. Petya believes that the surprise value of the results for students is equal to sum limits_{i=1}^{n} |x_i - r_i| , where r_i is the number of points that the i -th student has got for the test. Your task is to help Petya find such a permutation p for which the surprise value of the results is maximum possible. If there are multiple answers, print any of them. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains two integers n and m ( 1 <= n <= 10 ; 1 <= m <= 10^4 ) -- the number of students and the number of questions, respectively. The second line contains n integers x_1, x_2, ... , x_n ( 0 <= x_i <= frac{m(m+1)}{2} ), where x_i is the number of points that the i -th student expects to get. This is followed by n lines, the i -th line contains the string s_i ( |s_i| = m; s_{i, j} in {0, 1 } ), where s_{i, j} is 1 if the i -th student has answered the j -th question correctly, and 0 otherwise. The sum of m for all test cases does not exceed 10^4 . For each test case, print m integers -- a permutation p for which the surprise value of the results is maximum possible. If there are multiple answers, print any of them. '... |
Educational Codeforces Round 120 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
140815407 | nwi | E | Dec. 27, 2021, 4:25 p.m. | OK | GNU C++14 | TESTS | 36 | 421 | 716800 | ||
140848728 | L7-56 | E | Dec. 28, 2021, 1:25 a.m. | OK | GNU C++14 | TESTS | 36 | 468 | 614400 | ||
140820121 | 0wuming0 | E | Dec. 27, 2021, 4:33 p.m. | OK | GNU C++14 | TESTS | 36 | 483 | 3584000 | ||
140822714 | Werner_Yin | E | Dec. 27, 2021, 4:43 p.m. | OK | GNU C++14 | TESTS | 36 | 514 | 307200 | ||
140848680 | L7-56 | E | Dec. 28, 2021, 1:22 a.m. | OK | GNU C++14 | TESTS | 36 | 514 | 614400 | ||
140852877 | uli_ | E | Dec. 28, 2021, 3:30 a.m. | OK | GNU C++14 | TESTS | 36 | 639 | 307200 | ||
140819723 | AWR2020 | E | Dec. 27, 2021, 4:33 p.m. | OK | GNU C++14 | TESTS | 36 | 670 | 307200 | ||
140851478 | bkifhr7 | E | Dec. 28, 2021, 2:54 a.m. | OK | GNU C++14 | TESTS | 36 | 717 | 307200 | ||
140828504 | QWQmaster | E | Dec. 27, 2021, 5:29 p.m. | OK | GNU C++14 | TESTS | 36 | 733 | 614400 | ||
140848350 | NazunaHiwatashi | E | Dec. 28, 2021, 1:09 a.m. | OK | GNU C++14 | TESTS | 36 | 764 | 512000 | ||
140816161 | U_U | E | Dec. 27, 2021, 4:26 p.m. | OK | GNU C++17 | TESTS | 36 | 171 | 716800 | ||
140826859 | sleepwalking643 | E | Dec. 27, 2021, 5:13 p.m. | OK | GNU C++17 | TESTS | 36 | 343 | 512000 | ||
140826742 | sleepwalking643 | E | Dec. 27, 2021, 5:12 p.m. | OK | GNU C++17 | TESTS | 36 | 343 | 512000 | ||
140836135 | stevancv | E | Dec. 27, 2021, 7:03 p.m. | OK | GNU C++17 | TESTS | 36 | 390 | 614400 | ||
140851113 | AhoCorasick | E | Dec. 28, 2021, 2:45 a.m. | OK | GNU C++17 | TESTS | 36 | 390 | 3686400 | ||
140821641 | BrayanD | E | Dec. 27, 2021, 4:37 p.m. | OK | GNU C++17 | TESTS | 36 | 452 | 1843200 | ||
140824569 | Kaitokid | E | Dec. 27, 2021, 4:55 p.m. | OK | GNU C++17 | TESTS | 36 | 483 | 1331200 | ||
140833138 | islingr | E | Dec. 27, 2021, 6:23 p.m. | OK | GNU C++17 | TESTS | 36 | 514 | 409600 | ||
140822323 | chiera | E | Dec. 27, 2021, 4:41 p.m. | OK | GNU C++17 | TESTS | 36 | 577 | 512000 | ||
140823861 | MOPKOBKA228 | E | Dec. 27, 2021, 4:51 p.m. | OK | GNU C++17 | TESTS | 36 | 624 | 409600 | ||
140815622 | horsegirl | E | Dec. 27, 2021, 4:25 p.m. | OK | GNU C++17 (64) | TESTS | 36 | 155 | 409600 | ||
140838345 | neal | E | Dec. 27, 2021, 7:38 p.m. | OK | GNU C++17 (64) | TESTS | 36 | 187 | 409600 | ||
140834147 | korokseeds | E | Dec. 27, 2021, 6:36 p.m. | OK | GNU C++17 (64) | TESTS | 36 | 312 | 307200 | ||
140815567 | scol | E | Dec. 27, 2021, 4:25 p.m. | OK | GNU C++17 (64) | TESTS | 36 | 374 | 512000 | ||
140824393 | Fysty | E | Dec. 27, 2021, 4:54 p.m. | OK | GNU C++17 (64) | TESTS | 36 | 390 | 512000 | ||
140857934 | EricQian | E | Dec. 28, 2021, 5:11 a.m. | OK | GNU C++17 (64) | TESTS | 36 | 421 | 307200 | ||
140827815 | Lucina | E | Dec. 27, 2021, 5:22 p.m. | OK | GNU C++17 (64) | TESTS | 36 | 514 | 2662400 | ||
140828204 | Lucina | E | Dec. 27, 2021, 5:26 p.m. | OK | GNU C++17 (64) | TESTS | 36 | 546 | 2662400 | ||
140848340 | NazunaHiwatashi | E | Dec. 28, 2021, 1:08 a.m. | OK | GNU C++17 (64) | TESTS | 36 | 561 | 307200 | ||
140826306 | suzuken_w | E | Dec. 27, 2021, 5:08 p.m. | OK | GNU C++17 (64) | TESTS | 36 | 607 | 409600 | ||
140856921 | geruome | E | Dec. 28, 2021, 4:54 a.m. | OK | GNU C++20 (64) | TESTS | 36 | 124 | 1024000 | ||
140816472 | Kira_1234 | E | Dec. 27, 2021, 4:27 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 171 | 819200 | ||
140848651 | qwaszxwillwinioi2022 | E | Dec. 28, 2021, 1:21 a.m. | OK | GNU C++20 (64) | TESTS | 36 | 312 | 37273600 | ||
140817974 | ParthDwivedi | E | Dec. 27, 2021, 4:30 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 343 | 409600 | ||
140836086 | achvanov | E | Dec. 27, 2021, 7:02 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 358 | 614400 | ||
140855785 | Lavine | E | Dec. 28, 2021, 4:33 a.m. | OK | GNU C++20 (64) | TESTS | 36 | 389 | 307200 | ||
140838837 | tepamid | E | Dec. 27, 2021, 7:46 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 390 | 307200 | ||
140836013 | acfinity | E | Dec. 27, 2021, 7:01 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 452 | 307200 | ||
140824303 | keta_tsimakuridze | E | Dec. 27, 2021, 4:54 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 452 | 512000 | ||
140830236 | kiyoshi0205 | E | Dec. 27, 2021, 5:47 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 483 | 614400 | ||
140841036 | long2142453426 | E | Dec. 27, 2021, 8:31 p.m. | OK | Java 11 | TESTS | 36 | 1653 | 0 | ||
140846528 | robinz62 | E | Dec. 27, 2021, 11:38 p.m. | OK | Java 11 | TESTS | 36 | 1699 | 0 | ||
140823586 | PetrNguyen | E | Dec. 27, 2021, 4:49 p.m. | OK | Java 11 | TESTS | 36 | 1934 | 0 | ||
140854712 | wowicecreamissootasty | E | Dec. 28, 2021, 4:11 a.m. | OK | Java 8 | TESTS | 36 | 1216 | 0 | ||
140854745 | wowicecreamissootasty | E | Dec. 28, 2021, 4:12 a.m. | OK | Java 8 | TESTS | 36 | 1278 | 0 | ||
140819865 | AndreySiunov | E | Dec. 27, 2021, 4:33 p.m. | OK | Java 8 | TESTS | 36 | 1434 | 0 | ||
140838942 | r57shell | E | Dec. 27, 2021, 7:48 p.m. | OK | MS C++ 2017 | TESTS | 36 | 764 | 614400 | ||
140845147 | eepsilon | E | Dec. 27, 2021, 10:32 p.m. | OK | PyPy 3-64 | TESTS | 36 | 1169 | 10547200 | ||
140837209 | RustyInCP | E | Dec. 27, 2021, 7:19 p.m. | OK | Rust 2021 | TESTS | 36 | 1138 | 1126400 |
Back to search problems