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
( 415 ) H Rainbow Triples PROGRAMMING greedy

B"You are given a sequence a_1, a_2, ldots, a_n of non-negative integers. You need to find the largest number m of triples (i_1, j_1, k_1) , (i_2, j_2, k_2) , ..., (i_m, j_m, k_m) such that: The first line of input contains one integer t ( 1 <= q t <= q 500 ,000 ): the number of test cases. The first line of each test case contains one integer n ( 1 <= q n <= q 500 ,000 ). The second line contains n integers a_1, a_2, ldots, a_n ( 0 <= q a_i <= q n ). The total sum of n is at most 500 ,000 . For each test case, print one integer m : the largest number of proper triples that you can find. In the first two test cases, there are not enough elements even for a single triple, so the answer is 0 . In the third test case we can select one triple (1, 2, 3) . In the fourth test case we can select two triples (1, 3, 5) and (2, 4, 6) . In the fifth test case we can select one triple (1, 2, 3) . We can't select two triples (1, 2, 3) and (4, 5, 6) , because a_2 = a_5 . "...

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
94367760 Misaka-Mikoto- H Oct. 1, 2020, 2:08 a.m. OK GNU C++11 TESTS 93 218 23244800
94369554 137_345_2814 H Oct. 1, 2020, 2:57 a.m. OK GNU C++11 TESTS 93 233 41984000
94377259 Eric_hooo H Oct. 1, 2020, 5:41 a.m. OK GNU C++11 TESTS 93 264 34508800
94370104 little_waxberry H Oct. 1, 2020, 3:11 a.m. OK GNU C++11 TESTS 93 1310 26316800
94369304 137_345_2814 H Oct. 1, 2020, 2:50 a.m. OK GNU C++11 TESTS 93 1965 41984000
94336587 Um_nik H Sept. 30, 2020, 4:29 p.m. OK GNU C++17 TESTS 93 311 35225600
94340051 tourist H Sept. 30, 2020, 4:46 p.m. OK GNU C++17 TESTS 93 436 12083200
94368866 I_Love_Tourist_ H Oct. 1, 2020, 2:38 a.m. OK GNU C++17 TESTS 93 686 81408000
94335780 ainta H Sept. 30, 2020, 4:25 p.m. OK GNU C++17 TESTS 93 686 81408000
94348029 antontrygubO_o H Sept. 30, 2020, 5:47 p.m. OK GNU C++17 TESTS 93 1512 18227200
94364818 Burunduk1 H Oct. 1, 2020, 12:26 a.m. OK GNU C++17 (64) TESTS 93 62 13414400
94364587 Burunduk1 H Oct. 1, 2020, 12:16 a.m. OK GNU C++17 (64) TESTS 93 171 21913600
94340818 maroonrk H Sept. 30, 2020, 4:50 p.m. OK GNU C++17 (64) TESTS 93 202 42598400
94361253 Benq H Sept. 30, 2020, 9:43 p.m. OK GNU C++17 (64) TESTS 93 264 18944000
94343526 Egor H Sept. 30, 2020, 5:05 p.m. OK GNU C++17 (64) TESTS 93 265 26931200
94351634 sh1194 H Sept. 30, 2020, 6:24 p.m. OK GNU C++17 (64) TESTS 93 311 34611200
94350072 ecnerwala H Sept. 30, 2020, 6:05 p.m. OK GNU C++17 (64) TESTS 93 311 34611200
94335069 ksun48 H Sept. 30, 2020, 4:21 p.m. OK GNU C++17 (64) TESTS 93 389 46284800
94334966 Benq H Sept. 30, 2020, 4:21 p.m. OK GNU C++17 (64) TESTS 93 748 35532800

remove filters

Back to search problems