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 |
---|---|---|---|---|---|---|
1641 | Codeforces Round 773 (Div. 1) | FINISHED | False | 7200 | 86212199 | Feb. 23, 2022, 10:10 a.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1184 ) | D | Two Arrays | PROGRAMMING | bitmasks brute force combinatorics hashing probabilities two pointers |
B'Sam changed his school and on the first biology lesson he got a very interesting task about genes. You are given n arrays, the i -th of them contains m different integers -- a_{i,1}, a_{i,2}, ldots,a_{i,m} . Also you are given an array of integers w of length n . Find the minimum value of w_i + w_j among all pairs of integers (i, j) ( 1 <= i, j <= n ), such that the numbers a_{i,1}, a_{i,2}, ldots,a_{i,m}, a_{j,1}, a_{j,2}, ldots,a_{j,m} are distinct. The first line contains two integers n , m ( 2 <= q n <= q 10^5 , 1 <= m <= 5 ). The i -th of the next n lines starts with m distinct integers a_{i,1}, a_{i,2}, ldots, a_{i,m} and then w_i follows ( 1 <= q a_{i,j} <= q 10^9 , 1 <= q w_{i} <= q 10^9 ). Print a single number -- the answer to the problem. If there are no suitable pairs (i, j) , print -1 . In the first test the minimum value is 5 = w_3 + w_4 , because numbers {2, 3, 4, 5 } are distinct. In the second test case, there are no suitable pair (i, j) . '... |
Codeforces Round #773 editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
147485818 | orzdevinwang | D | Feb. 23, 2022, 3:02 p.m. | OK | GNU C++14 | TESTS | 87 | 592 | 7065600 | ||
147454785 | fengzhengwei | D | Feb. 23, 2022, 11:36 a.m. | OK | GNU C++14 | TESTS | 87 | 624 | 344166400 | ||
147486394 | orzdevinwang | D | Feb. 23, 2022, 3:07 p.m. | OK | GNU C++14 | TESTS | 87 | 655 | 6963200 | ||
147523580 | Tyyyyyy | D | Feb. 24, 2022, 1:09 a.m. | OK | GNU C++14 | TESTS | 90 | 670 | 23040000 | ||
147523569 | Tyyyyyy | D | Feb. 24, 2022, 1:09 a.m. | OK | GNU C++14 | TESTS | 90 | 763 | 23040000 | ||
147439795 | meyi | D | Feb. 23, 2022, 10:57 a.m. | OK | GNU C++14 | TESTS | 87 | 811 | 189235200 | ||
147525804 | Acfboy | D | Feb. 24, 2022, 2:13 a.m. | OK | GNU C++14 | TESTS | 90 | 826 | 8806400 | ||
147485731 | orzdevinwang | D | Feb. 23, 2022, 3:01 p.m. | OK | GNU C++14 | TESTS | 87 | 888 | 7372800 | ||
147468571 | StaroForgin | D | Feb. 23, 2022, 12:47 p.m. | OK | GNU C++14 | TESTS | 87 | 1091 | 51097600 | ||
147479379 | Mackerel_Pike | D | Feb. 23, 2022, 2:04 p.m. | OK | GNU C++14 | TESTS | 87 | 1091 | 51507200 | ||
147517840 | nocap | D | Feb. 23, 2022, 10:09 p.m. | OK | GNU C++17 | TESTS | 88 | 499 | 10752000 | ||
147475617 | DeadlyPillow | D | Feb. 23, 2022, 1:33 p.m. | OK | GNU C++17 | TESTS | 87 | 514 | 18739200 | ||
147454778 | zemen | D | Feb. 23, 2022, 11:36 a.m. | OK | GNU C++17 | TESTS | 87 | 561 | 23142400 | ||
147514108 | ilyakrasnovv | D | Feb. 23, 2022, 8:39 p.m. | OK | GNU C++17 | TESTS | 88 | 982 | 21504000 | ||
147445102 | huzhaoyang | D | Feb. 23, 2022, 11:09 a.m. | OK | GNU C++17 | TESTS | 87 | 1014 | 35123200 | ||
147534819 | liangjs | D | Feb. 24, 2022, 5:18 a.m. | OK | GNU C++17 | TESTS | 90 | 1045 | 30720000 | ||
147520288 | YaoBIG | D | Feb. 23, 2022, 11:28 p.m. | OK | GNU C++17 | TESTS | 88 | 1060 | 7987200 | ||
147473720 | Tima | D | Feb. 23, 2022, 1:19 p.m. | OK | GNU C++17 | TESTS | 87 | 1076 | 71372800 | ||
147481420 | bthero | D | Feb. 23, 2022, 2:22 p.m. | OK | GNU C++17 | TESTS | 87 | 1138 | 36966400 | ||
147515674 | Radewoosh | D | Feb. 23, 2022, 9:14 p.m. | OK | GNU C++17 | TESTS | 88 | 1185 | 52633600 | ||
147525791 | xay5421 | D | Feb. 24, 2022, 2:13 a.m. | OK | GNU C++17 (64) | TESTS | 90 | 358 | 6963200 | ||
147487379 | BigBag | D | Feb. 23, 2022, 3:16 p.m. | OK | GNU C++17 (64) | TESTS | 87 | 358 | 9625600 | ||
147460534 | Xellos | D | Feb. 23, 2022, 11:56 a.m. | OK | GNU C++17 (64) | TESTS | 87 | 404 | 25088000 | ||
147487332 | BigBag | D | Feb. 23, 2022, 3:16 p.m. | OK | GNU C++17 (64) | TESTS | 87 | 498 | 9625600 | ||
147456514 | LayCurse | D | Feb. 23, 2022, 11:42 a.m. | OK | GNU C++17 (64) | TESTS | 87 | 498 | 137728000 | ||
147521104 | Alfalfa_w | D | Feb. 23, 2022, 11:55 p.m. | OK | GNU C++17 (64) | TESTS | 89 | 514 | 9011200 | ||
147454536 | errorgorn | D | Feb. 23, 2022, 11:36 a.m. | OK | GNU C++17 (64) | TESTS | 87 | 530 | 64307200 | ||
147460672 | basic_string | D | Feb. 23, 2022, 11:56 a.m. | OK | GNU C++17 (64) | TESTS | 87 | 592 | 169881600 | ||
147471648 | RiverHamster | D | Feb. 23, 2022, 1:05 p.m. | OK | GNU C++17 (64) | TESTS | 87 | 623 | 113254400 | ||
147438905 | codelegend | D | Feb. 23, 2022, 10:55 a.m. | OK | GNU C++17 (64) | TESTS | 87 | 655 | 52736000 | ||
147473722 | golikovnik | D | Feb. 23, 2022, 1:19 p.m. | OK | GNU C++20 (64) | TESTS | 87 | 327 | 11264000 | ||
147473640 | golikovnik | D | Feb. 23, 2022, 1:19 p.m. | OK | GNU C++20 (64) | TESTS | 87 | 421 | 11264000 | ||
147529902 | lasbase | D | Feb. 24, 2022, 3:49 a.m. | OK | GNU C++20 (64) | TESTS | 90 | 452 | 29388800 | ||
147529852 | lasbase | D | Feb. 24, 2022, 3:48 a.m. | OK | GNU C++20 (64) | TESTS | 90 | 467 | 29388800 | ||
147529823 | lasbase | D | Feb. 24, 2022, 3:47 a.m. | OK | GNU C++20 (64) | TESTS | 90 | 467 | 29388800 | ||
147481525 | generic_placeholder_name | D | Feb. 23, 2022, 2:22 p.m. | OK | GNU C++20 (64) | TESTS | 87 | 467 | 29388800 | ||
147529946 | lasbase | D | Feb. 24, 2022, 3:50 a.m. | OK | GNU C++20 (64) | TESTS | 90 | 467 | 86937600 | ||
147529781 | lasbase | D | Feb. 24, 2022, 3:46 a.m. | OK | GNU C++20 (64) | TESTS | 90 | 468 | 29388800 | ||
147529754 | lasbase | D | Feb. 24, 2022, 3:46 a.m. | OK | GNU C++20 (64) | TESTS | 90 | 468 | 29388800 | ||
147474118 | Kostroma | D | Feb. 23, 2022, 1:22 p.m. | OK | GNU C++20 (64) | TESTS | 87 | 468 | 104345600 | ||
147454412 | uwi | D | Feb. 23, 2022, 11:35 a.m. | OK | Java 11 | TESTS | 87 | 2168 | 10752000 | ||
147486179 | iakovlev.zakhar | D | Feb. 23, 2022, 3:06 p.m. | OK | Java 8 | TESTS | 87 | 1465 | 58368000 | ||
147486039 | iakovlev.zakhar | D | Feb. 23, 2022, 3:04 p.m. | OK | Java 8 | TESTS | 87 | 1497 | 58368000 | ||
147486022 | iakovlev.zakhar | D | Feb. 23, 2022, 3:04 p.m. | OK | Java 8 | TESTS | 87 | 1528 | 58368000 | ||
147456922 | iakovlev.zakhar | D | Feb. 23, 2022, 11:43 a.m. | OK | Java 8 | TESTS | 87 | 1528 | 58368000 | ||
147486092 | iakovlev.zakhar | D | Feb. 23, 2022, 3:05 p.m. | OK | Java 8 | TESTS | 87 | 1840 | 356659200 | ||
147511200 | qwerty787788 | D | Feb. 23, 2022, 7:49 p.m. | OK | Rust 2021 | TESTS | 88 | 436 | 55808000 | ||
147485313 | sansen | D | Feb. 23, 2022, 2:57 p.m. | OK | Rust 2021 | TESTS | 87 | 483 | 19148800 | ||
147483066 | sansen | D | Feb. 23, 2022, 2:36 p.m. | OK | Rust 2021 | TESTS | 87 | 546 | 19148800 | ||
147483415 | sansen | D | Feb. 23, 2022, 2:39 p.m. | OK | Rust 2021 | TESTS | 87 | 638 | 18124800 | ||
147478380 | sansen | D | Feb. 23, 2022, 1:56 p.m. | OK | Rust 2021 | TESTS | 87 | 639 | 126976000 | ||
147476466 | sansen | D | Feb. 23, 2022, 1:39 p.m. | OK | Rust 2021 | TESTS | 87 | 841 | 127385600 | ||
147482422 | sansen | D | Feb. 23, 2022, 2:30 p.m. | OK | Rust 2021 | TESTS | 87 | 889 | 22323200 | ||
147476079 | sansen | D | Feb. 23, 2022, 1:36 p.m. | OK | Rust 2021 | TESTS | 87 | 1294 | 175206400 | ||
147525007 | sansen | D | Feb. 24, 2022, 1:51 a.m. | OK | Rust 2021 | TESTS | 90 | 2324 | 322867200 | ||
147524933 | sansen | D | Feb. 24, 2022, 1:49 a.m. | OK | Rust 2021 | TESTS | 90 | 2558 | 284467200 |
Back to search problems