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 |
---|---|---|---|---|---|---|
1578 | ICPC WF Moscow Invitational Contest - Online Mirror (Unrated, ICPC Rules, Teams Preferred) | FINISHED | False | 18000 | 104172863 | Oct. 1, 2021, 1:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 371 ) | K | Kingdom of Islands | PROGRAMMING | graphs implementation |
B'The Kingdom of Islands consists of p islands. As the king, you rule over the whole kingdom, while each island is ruled over by one or several jarls under your rule. In total, there are n jarls under your jurisdiction. Each island of the kingdom has its own strong traditions, so jarls that rule over the same island support each other and never have conflicts. The downsides of such strength are cultural conflicts between people inhabiting different islands. Thus, two jarls that rule over different islands are in conflict. However, recent years brought a few changes to traditional relations between the jarls. To your knowledge, there are exactly k pairs of jarls such that relationships between two jarls in the pair are different from the traditional. That is, if two jarls of the pair you know rule over the same island, these jarls are in conflict. If they rule over different islands, then they overcome cultural disagreement and there is no conflict between them anymore. As a true responsible king, you are worried about whether the kingdom is close to a major conflict. In order to estimate the current situation, you would like to find the largest possible group of jarls such that every two jarls in the group are in conflict. The first line of the input consists of two integers p and n ( 1 <= p <= n <= 10^5 ; 1 <= p <= 10^4 ). The second line consists of n integers s_1, s_2, ldots, s_n ( 1 <= s_i <= p ). The integer s_i denotes that the i -th jarl rules over the island number s_i . It is guaranteed that each island is ruled by at least one jarl. The third line consists of a single integer k ( 0 <= k <= 20 ). Then k lines follow. The j -th of these lines consists of two distinct integers a_j and b_j ( 1 <= a_j < b_j <= n ), denoting that the relation between the a_j -th jarl and the b_j -th jarl differs from traditional. It is guarant'... |
Tutorial (PDF) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
130481755 | gs18115 Retro3014 Gom | K | Oct. 1, 2021, 3:47 p.m. | OK | GNU C++14 | TESTS | 53 | 327 | 7475200 | ||
130476405 | tun | K | Oct. 1, 2021, 2:52 p.m. | OK | GNU C++14 | TESTS | 53 | 374 | 6963200 | ||
130488564 | chenkuowen Suiseiseki RiverHamster | K | Oct. 1, 2021, 5 p.m. | OK | GNU C++14 | TESTS | 53 | 374 | 9216000 | ||
130482353 | eecs | K | Oct. 1, 2021, 3:52 p.m. | OK | GNU C++14 | TESTS | 53 | 390 | 26316800 | ||
130480344 | I_love_tigersugar khuebeo chemthan | K | Oct. 1, 2021, 3:32 p.m. | OK | GNU C++14 | TESTS | 53 | 608 | 43008000 | ||
130513231 | expwmh | K | Oct. 2, 2021, 1:25 a.m. | OK | GNU C++14 | TESTS | 53 | 1029 | 8294400 | ||
130491411 | expwmh hydd Qingyu | K | Oct. 1, 2021, 5:29 p.m. | OK | GNU C++14 | TESTS | 53 | 1029 | 8294400 | ||
130513905 | expwmh | K | Oct. 2, 2021, 1:50 a.m. | OK | GNU C++14 | TESTS | 53 | 1404 | 8294400 | ||
130513256 | expwmh | K | Oct. 2, 2021, 1:26 a.m. | OK | GNU C++14 | TESTS | 53 | 1404 | 8294400 | ||
130485383 | DoctorHai | K | Oct. 1, 2021, 4:26 p.m. | OK | GNU C++14 | TESTS | 53 | 1933 | 12390400 | ||
130481625 | user202729_ tanphatls987 | K | Oct. 1, 2021, 3:45 p.m. | OK | GNU C++17 | TESTS | 53 | 46 | 5017600 | ||
130499666 | phathnv202 | K | Oct. 1, 2021, 7:01 p.m. | OK | GNU C++17 | TESTS | 53 | 46 | 6144000 | ||
130493646 | Emiso joaom figdan | K | Oct. 1, 2021, 5:51 p.m. | OK | GNU C++17 | TESTS | 53 | 62 | 7065600 | ||
130488077 | veckoper DevourThemAll Eden_CY | K | Oct. 1, 2021, 4:55 p.m. | OK | GNU C++17 | TESTS | 53 | 62 | 9625600 | ||
130490973 | faustaadp | K | Oct. 1, 2021, 5:24 p.m. | OK | GNU C++17 | TESTS | 53 | 93 | 44953600 | ||
130469917 | xay5421 LJC00118 | K | Oct. 1, 2021, 1:56 p.m. | OK | GNU C++17 | TESTS | 53 | 249 | 386764800 | ||
130479195 | rheallyc cxaphoenix | K | Oct. 1, 2021, 3:20 p.m. | OK | GNU C++17 | TESTS | 53 | 311 | 9420800 | ||
130483939 | sfiction shb123 J.T.J.L. | K | Oct. 1, 2021, 4:10 p.m. | OK | GNU C++17 | TESTS | 53 | 312 | 5324800 | ||
130505906 | KhaledKEE | K | Oct. 1, 2021, 8:52 p.m. | OK | GNU C++17 | TESTS | 53 | 327 | 174899200 | ||
130472148 | 4182_543_731 | K | Oct. 1, 2021, 2:16 p.m. | OK | GNU C++17 | TESTS | 53 | 373 | 9420800 | ||
130481901 | yosupo | K | Oct. 1, 2021, 3:48 p.m. | OK | GNU C++17 (64) | TESTS | 53 | 31 | 5427200 | ||
130486252 | kshitij_sodani errorgorn jtnydv25 | K | Oct. 1, 2021, 4:35 p.m. | OK | GNU C++17 (64) | TESTS | 53 | 31 | 5529600 | ||
130523022 | wlzhouzhuan | K | Oct. 2, 2021, 5:05 a.m. | OK | GNU C++17 (64) | TESTS | 53 | 31 | 10240000 | ||
130522932 | Alan233 | K | Oct. 2, 2021, 5:04 a.m. | OK | GNU C++17 (64) | TESTS | 53 | 31 | 10240000 | ||
130479975 | rniya Rubikun yatuba | K | Oct. 1, 2021, 3:29 p.m. | OK | GNU C++17 (64) | TESTS | 53 | 46 | 5632000 | ||
130484970 | risujiroh | K | Oct. 1, 2021, 4:21 p.m. | OK | GNU C++17 (64) | TESTS | 53 | 46 | 6553600 | ||
130516710 | DreamingLeaf | K | Oct. 2, 2021, 3:08 a.m. | OK | GNU C++17 (64) | TESTS | 53 | 46 | 6860800 | ||
130478979 | tlwpdus ainta molamola. | K | Oct. 1, 2021, 3:18 p.m. | OK | GNU C++17 (64) | TESTS | 53 | 78 | 7168000 | ||
130494319 | Barichek Valera_Grinenko DJeniUp | K | Oct. 1, 2021, 5:57 p.m. | OK | GNU C++17 (64) | TESTS | 53 | 78 | 15052800 | ||
130486850 | snuke hos.lyric maroonrk | K | Oct. 1, 2021, 4:41 p.m. | OK | GNU C++17 (64) | TESTS | 53 | 124 | 7680000 | ||
130479557 | sansen | K | Oct. 1, 2021, 3:24 p.m. | OK | Rust | TESTS | 53 | 46 | 6246400 |
Back to search problems