Educational Codeforces Round 105 (Rated for 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
1494 Educational Codeforces Round 105 (Rated for Div. 2) FINISHED False 7200 122483663 March 2, 2021, 2:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2620 ) D Dogeforces PROGRAMMING brute force constructive algorithms divide and conquer ds greedy implementation trees

B'The Dogeforces company has k employees. Each employee, except for lower-level employees, has at least 2 subordinates. Lower-level employees have no subordinates. Each employee, except for the head of the company, has exactly one direct supervisor. The head of the company is a direct or indirect supervisor of all employees. It is known that in Dogeforces, each supervisor receives a salary strictly more than all his subordinates. The full structure of the company is a secret, but you know the number of lower-level employees and for each pair of lower-level employees, the salary of their common supervisor is known (if there are several such supervisors, then the supervisor with the minimum salary). You have to restore the structure of the company. The first line contains a single integer n ( 2 <= n <= 500 ) -- the number of lower-level employees. This is followed by n lines, where i -th line contains n integers a_{i,1}, a_{i,2}, ... , a_{i,n} ( 1 <= a_{i,j} <= 5000 ) -- salary of the common supervisor of employees with numbers i and j . It is guaranteed that a_{i,j} = a_{j,i} . Note that a_{i,i} is equal to the salary of the i -th employee. In the first line, print a single integer k -- the number of employees in the company. In the second line, print k integers c_1, c_2, ... , c_k , where c_i is the salary of the employee with the number i . In the third line, print a single integer r -- the number of the employee who is the head of the company. In the following k-1 lines, print two integers v and u ( 1 <= v, u <= k ) -- the number of the employee and his direct supervisor. Note that the lower-level employees have numbers from 1 to n , and for the rest of the employees, you have to assign numbers from n+1 to k . If there are several correct company structures, you can print any of them. One of '...

Tutorials

Educational Codeforces Round 105 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
108968504 2018LZY D March 3, 2021, 2:30 a.m. OK GNU C++11 TESTS 46 31 1126400
108977700 lin_rany D March 3, 2021, 6:02 a.m. OK GNU C++11 TESTS 46 31 3379200
108943581 zjjws D March 2, 2021, 4:43 p.m. OK GNU C++11 TESTS 46 31 5836800
108941704 Cornflakes D March 2, 2021, 4:39 p.m. OK GNU C++11 TESTS 46 31 17920000
108969879 hangyesheng D March 3, 2021, 3:15 a.m. OK GNU C++11 TESTS 46 46 5734400
108937819 SovietPower_ D March 2, 2021, 4:31 p.m. OK GNU C++11 TESTS 46 46 7065600
108941050 void_basic_learner D March 2, 2021, 4:38 p.m. OK GNU C++11 TESTS 46 46 15052800
108940355 clfzs D March 2, 2021, 4:36 p.m. OK GNU C++11 TESTS 46 46 16384000
108966588 Fairicle D March 3, 2021, 1:06 a.m. OK GNU C++11 TESTS 46 46 20480000
108966360 8I78541919 D March 3, 2021, 12:55 a.m. OK GNU C++11 TESTS 46 46 34099200
108975307 tsaraf D March 3, 2021, 5:21 a.m. OK GNU C++14 TESTS 46 62 16384000
108953750 KYoA_A D March 2, 2021, 6:17 p.m. OK GNU C++14 TESTS 46 77 2764800
108938286 aali_d D March 2, 2021, 4:32 p.m. OK GNU C++14 TESTS 46 77 3379200
108961769 Gorgo D March 2, 2021, 9 p.m. OK GNU C++14 TESTS 46 77 3788800
108962892 lmhoang D March 2, 2021, 9:38 p.m. OK GNU C++14 TESTS 46 77 6758400
108966879 SuperJ6 D March 3, 2021, 1:20 a.m. OK GNU C++14 TESTS 46 77 31027200
108949705 sievra D March 2, 2021, 5:25 p.m. OK GNU C++14 TESTS 46 78 5529600
108951757 _JJ D March 2, 2021, 5:49 p.m. OK GNU C++14 TESTS 46 78 7270400
108945750 aryanbidani D March 2, 2021, 4:50 p.m. OK GNU C++14 TESTS 46 78 9216000
108949463 critics D March 2, 2021, 5:23 p.m. OK GNU C++14 TESTS 46 78 10137600

remove filters

Back to search problems