Grakn Forces 2020

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
1408 Grakn Forces 2020 FINISHED False 9900 135876311 Sept. 30, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2019 ) E Avoid Rainbow Cycles PROGRAMMING ds graphs greedy sortings

B'You are given m sets of integers A_1, A_2, ldots, A_m ; elements of these sets are integers between 1 and n , inclusive. There are two arrays of positive integers a_1, a_2, ldots, a_m and b_1, b_2, ldots, b_n . In one operation you can delete an element j from the set A_i and pay a_i + b_j coins for that. You can make several (maybe none) operations (some sets can become empty). After that, you will make an edge-colored undirected graph consisting of n vertices. For each set A_i you will add an edge (x, y) with color i for all x, y in A_i and x < y . Some pairs of vertices can be connected with more than one edge, but such edges have different colors. You call a cycle i_1 to e_1 to i_2 to e_2 to ldots to i_k to e_k to i_1 ( e_j is some edge connecting vertices i_j and i_{j+1} in this graph) rainbow if all edges on it have different colors. Find the minimum number of coins you should pay to get a graph without rainbow cycles. The first line contains two integers m and n ( 1 <= q m, n <= q 10^5 ), the number of sets and the number of vertices in the graph. The second line contains m integers a_1, a_2, ldots, a_m ( 1 <= q a_i <= q 10^9 ). The third line contains n integers b_1, b_2, ldots, b_n ( 1 <= q b_i <= q 10^9 ). In the each of the next of m lines there are descriptions of sets. In the i -th line the first integer s_i ( 1 <= q s_i <= q n ) is equal to the size of A_i . Then s_i integers follow: the elements of the set A_i . These integers are from 1 to n and distinct. It is guaranteed that the sum of s_i for all 1 <= q i <= q m does not exceed 2 cdot 10^5 . Print one integer: the minimum number of coins you should pay for operations to avoid rainbow cycles in the obtained graph. In the first test, you can make such ope'...

Tutorials

Grakn Forces -- Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
94339167 hos.lyric E Sept. 30, 2020, 4:41 p.m. OK D TESTS 10 202 24371200
94363570 Karry5307 E Sept. 30, 2020, 11:26 p.m. OK GNU C++11 TESTS 10 46 5632000
94364006 zjf_juruo E Sept. 30, 2020, 11:47 p.m. OK GNU C++11 TESTS 10 46 5734400
94378004 luogu_bot1 E Oct. 1, 2020, 5:53 a.m. OK GNU C++11 TESTS 10 46 5939200
94369158 Juanzhang E Oct. 1, 2020, 2:46 a.m. OK GNU C++11 TESTS 10 46 5939200
94344075 SGColin E Sept. 30, 2020, 5:08 p.m. OK GNU C++11 TESTS 10 46 6451200
94368373 s_r_f E Oct. 1, 2020, 2:26 a.m. OK GNU C++11 TESTS 10 61 4403200
94342157 tzc_wk E Sept. 30, 2020, 4:58 p.m. OK GNU C++11 TESTS 10 61 5222400
94332395 M_sea E Sept. 30, 2020, 4:08 p.m. OK GNU C++11 TESTS 10 61 5939200
94341883 Rubbish12345 E Sept. 30, 2020, 4:56 p.m. OK GNU C++11 TESTS 10 61 8908800
94367446 TYGZ E Oct. 1, 2020, 1:59 a.m. OK GNU C++11 TESTS 10 62 6656000
94333023 YLWang E Sept. 30, 2020, 4:11 p.m. OK GNU C++14 TESTS 10 62 16998400
94356511 luisBah E Sept. 30, 2020, 7:44 p.m. OK GNU C++14 TESTS 10 93 6758400
94351815 ShafinKhadem E Sept. 30, 2020, 6:27 p.m. OK GNU C++14 TESTS 10 124 5632000
94352146 bktl1love E Sept. 30, 2020, 6:31 p.m. OK GNU C++14 TESTS 10 124 7987200
94370526 loulingli E Oct. 1, 2020, 3:21 a.m. OK GNU C++14 TESTS 10 139 4812800
94333256 nhho E Sept. 30, 2020, 4:13 p.m. OK GNU C++14 TESTS 10 139 5120000
94331333 NoTeamName E Sept. 30, 2020, 4:03 p.m. OK GNU C++14 TESTS 10 139 5120000
94354018 skywalkert E Sept. 30, 2020, 6:59 p.m. OK GNU C++14 TESTS 10 139 6348800
94331569 kimjihoon E Sept. 30, 2020, 4:04 p.m. OK GNU C++14 TESTS 10 139 6348800
94358905 caoash E Sept. 30, 2020, 8:36 p.m. OK GNU C++14 TESTS 10 139 7577600
94333165 LayCurse E Sept. 30, 2020, 4:12 p.m. OK GNU C++17 TESTS 10 62 104652800
94333139 Hasan0540 E Sept. 30, 2020, 4:12 p.m. OK GNU C++17 TESTS 10 109 5427200
94334322 Lawali E Sept. 30, 2020, 4:18 p.m. OK GNU C++17 TESTS 10 124 6348800
94334984 knightL E Sept. 30, 2020, 4:21 p.m. OK GNU C++17 TESTS 10 124 6963200
94364050 viniciustht E Sept. 30, 2020, 11:49 p.m. OK GNU C++17 TESTS 10 124 7680000
94368587 starve_to_death E Oct. 1, 2020, 2:31 a.m. OK GNU C++17 TESTS 10 124 25190400
94334531 hloya_ygrt E Sept. 30, 2020, 4:18 p.m. OK GNU C++17 TESTS 10 139 5939200
94345247 DerekFeng E Sept. 30, 2020, 5:14 p.m. OK GNU C++17 TESTS 10 139 6348800
94357730 Anonymous_Noob E Sept. 30, 2020, 8:08 p.m. OK GNU C++17 TESTS 10 139 6348800
94365440 lukkka E Oct. 1, 2020, 12:50 a.m. OK GNU C++17 TESTS 10 139 6758400
94367477 RiverHamster E Oct. 1, 2020, 2 a.m. OK GNU C++17 (64) TESTS 10 46 12185600
94369119 I_Love_Tourist_ E Oct. 1, 2020, 2:45 a.m. OK GNU C++17 (64) TESTS 10 46 105881600
94337404 IgorSmirnov E Sept. 30, 2020, 4:33 p.m. OK GNU C++17 (64) TESTS 10 61 13004800
94337644 LiChenKoh E Sept. 30, 2020, 4:34 p.m. OK GNU C++17 (64) TESTS 10 62 5836800
94331962 FlowerOfSorrow E Sept. 30, 2020, 4:06 p.m. OK GNU C++17 (64) TESTS 10 93 5734400
94334824 niconiconii E Sept. 30, 2020, 4:20 p.m. OK GNU C++17 (64) TESTS 10 93 5836800
94338606 pr3pony E Sept. 30, 2020, 4:39 p.m. OK GNU C++17 (64) TESTS 10 93 7475200
94357768 smax E Sept. 30, 2020, 8:08 p.m. OK GNU C++17 (64) TESTS 10 93 7577600
94335261 Byobe E Sept. 30, 2020, 4:22 p.m. OK GNU C++17 (64) TESTS 10 93 8192000
94336470 Ari E Sept. 30, 2020, 4:28 p.m. OK GNU C++17 (64) TESTS 10 93 8294400
94349991 Ahmad E Sept. 30, 2020, 6:04 p.m. OK Java 11 TESTS 10 296 3788800
94339239 lucasr E Sept. 30, 2020, 4:42 p.m. OK Java 11 TESTS 10 358 7475200
94359932 bobib E Sept. 30, 2020, 9:01 p.m. OK Java 11 TESTS 10 358 7884800
94356713 Agnimandur E Sept. 30, 2020, 7:48 p.m. OK Java 11 TESTS 10 389 5427200
94362030 NatInTheHat E Sept. 30, 2020, 10:15 p.m. OK Java 8 TESTS 10 264 4915200
94337502 cwise E Sept. 30, 2020, 4:33 p.m. OK Java 8 TESTS 10 296 4198400
94360999 polyakoff E Sept. 30, 2020, 9:34 p.m. OK Java 8 TESTS 10 296 4812800
94355217 fetetriste E Sept. 30, 2020, 7:20 p.m. OK Java 8 TESTS 10 296 7884800
94349817 Java E Sept. 30, 2020, 6:02 p.m. OK Java 8 TESTS 10 311 6553600
94336744 SaveVMK E Sept. 30, 2020, 4:30 p.m. OK Java 8 TESTS 10 716 140390400
94331790 Tlatoani E Sept. 30, 2020, 4:06 p.m. OK Kotlin TESTS 10 483 30105600
94365846 baep_j E Oct. 1, 2020, 1:07 a.m. OK MS C++ 2017 TESTS 10 171 9420800
94366314 shirowa E Oct. 1, 2020, 1:25 a.m. OK MS C++ 2017 TESTS 10 171 10035200
94334734 ialakhtin E Sept. 30, 2020, 4:19 p.m. OK MS C++ 2017 TESTS 10 468 7782400
94352242 EmK E Sept. 30, 2020, 6:32 p.m. OK .NET Core C# TESTS 10 186 26112000
94368264 ngoc.ks E Oct. 1, 2020, 2:23 a.m. OK Node.js TESTS 10 483 45158400
94355617 su565fx E Sept. 30, 2020, 7:27 p.m. OK PyPy 3 TESTS 10 779 27955200
94373374 nehan_der_thal E Oct. 1, 2020, 4:30 a.m. OK PyPy 3 TESTS 10 811 37376000
94354984 su565fx E Sept. 30, 2020, 7:16 p.m. OK PyPy 3 TESTS 10 841 27545600
94334983 pineriver E Sept. 30, 2020, 4:21 p.m. OK PyPy 3 TESTS 10 935 27852800
94343833 nagiss E Sept. 30, 2020, 5:07 p.m. OK PyPy 3 TESTS 10 935 42598400
94354896 zii.hrs E Sept. 30, 2020, 7:14 p.m. OK PyPy 3 TESTS 10 951 40038400
94350317 sh1194 E Sept. 30, 2020, 6:07 p.m. OK PyPy 3 TESTS 10 966 33587200
94351757 kclee2172 E Sept. 30, 2020, 6:26 p.m. OK PyPy 3 TESTS 10 966 44953600
94354931 zii.hrs E Sept. 30, 2020, 7:15 p.m. OK PyPy 3 TESTS 10 967 39116800
94371654 tanon710 E Oct. 1, 2020, 3:50 a.m. OK PyPy 3 TESTS 10 982 34816000
94345186 cotton100pc E Sept. 30, 2020, 5:13 p.m. OK Rust TESTS 10 140 17305600

remove filters

Back to search problems