Codeforces Round 824 (Div. 2)

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
1735 Codeforces Round 824 (Div. 2) FINISHED False 8100 67101899 Oct. 2, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1072 ) E House Planning PROGRAMMING constructive algorithms data structures flows graph matchings greedy

B'There are n houses in your city arranged on an axis at points h_1, h_2, ldots, h_n . You want to build a new house for yourself and consider two options where to place it: points p_1 and p_2 . As you like visiting friends, you have calculated in advance the distances from both options to all existing houses. More formally, you have calculated two arrays d_1 , d_2 : d_{i, j} = <= ft|p_i - h_j right| , where |x| defines the absolute value of x . After a long time of inactivity you have forgotten the locations of the houses h and the options p_1 , p_2 . But your diary still keeps two arrays -- d_1 , d_2 , whose authenticity you doubt. Also, the values inside each array could be shuffled, so values at the same positions of d_1 and d_2 may correspond to different houses. Pay attention, that values from one array could not get to another, in other words, all values in the array d_1 correspond the distances from p_1 to the houses, and in the array d_2 -- from p_2 to the houses. Also pay attention, that the locations of the houses h_i and the considered options p_j could match. For example, the next locations are correct: h = {1, 0, 3, 3 } , p = {1, 1 } , that could correspond to already shuffled d_1 = {0, 2, 1, 2 } , d_2 = {2, 2, 1, 0 } . Check whether there are locations of houses h and considered points p_1 , p_2 , for which the founded arrays of distances would be correct. If it is possible, find appropriate locations of houses and considered options. The first line of the input contains a single integer t ( 1 <= t <= 10^3 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains one integer n ( 1 <= n <= 10^3 ) -- the length of arrays d_1 , d_2 . The next two lines contain n integers each: arrays '...

Tutorials

Codeforces Round #824 — editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
174442051 TEoS E Oct. 2, 2022, 7:13 p.m. OK GNU C++14 TESTS 45 15 0
174440366 anothercpaccount E Oct. 2, 2022, 6:50 p.m. OK GNU C++14 TESTS 45 31 307200
174426498 08kevin-02 E Oct. 2, 2022, 4:43 p.m. OK GNU C++14 TESTS 44 31 6451200
174423975 JPMarat E Oct. 2, 2022, 4:33 p.m. OK GNU C++14 TESTS 44 46 102400
174470196 GreatLiangpi E Oct. 3, 2022, 5:24 a.m. OK GNU C++14 TESTS 48 156 204800
174456340 Ecrade_ E Oct. 3, 2022, 12:49 a.m. OK GNU C++14 TESTS 47 265 8294400
174456324 Ecrade_ E Oct. 3, 2022, 12:48 a.m. OK GNU C++14 TESTS 47 280 8294400
174430445 omeganot E Oct. 2, 2022, 5:19 p.m. OK GNU C++14 TESTS 44 312 716800
174433063 hxlAKioi E Oct. 2, 2022, 5:36 p.m. OK GNU C++14 TESTS 44 343 307200
174468117 jucason_chen E Oct. 3, 2022, 4:52 a.m. OK GNU C++14 TESTS 48 358 819200

remove filters

Back to search problems