Codeforces Round 877 (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
1838 Codeforces Round 877 (Div. 2) FINISHED False 7200 51376463 June 4, 2023, 2:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 21779 ) A Blackboard List PROGRAMMING math

B'Two integers were written on a blackboard. After that, the following step was carried out n-2 times: After this process was complete, the list of n integers was shuffled. You are given the final list. Recover one of the initial two numbers. You do not need to recover the other one. You are guaranteed that the input can be generated using the above process. The first line of the input contains a single integer t ( 1 <= t <= 100 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 3 <= n <= 100 ) -- the size of the final list. The next line of each test case contains n integers a_1, a_2, ldots a_n ( -10^9 <= a_i <= 10^9 ) -- the shuffled list of numbers written on the blackboard. It is guaranteed that the input was generated using the process described above. For each test case, output a single integer x -- one of the two initial numbers on the blackboard. If there are multiple solutions, print any of them. For the first test case, a can be produced by starting with either 9 and 2 , and then writing down |9-2|=7 , or starting with 9 and 7 and writing down |9-7|=2 . So 2 , 7 , and 9 are all valid answers, because they all appear in at least one valid pair. For the second test case, we can show that the two initial numbers must have been -4 and 11 . For the fourth test case, the starting numbers could have been either 3 and 3 , or 3 and 0 , so 3 and 0 are both valid answers. For the fifth test case, we can show that the starting numbers were 8 and 16 . '...

Tutorials

Codeforces Round #877 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
208535100 Korse A June 5, 2023, 12:41 a.m. OK Clang++17 Diagnostics TESTS 10 62 7372800
208553117 HarshSaw_123 A June 5, 2023, 5:36 a.m. OK GNU C++14 TESTS 10 15 0
208552960 __Raghuram A June 5, 2023, 5:34 a.m. OK GNU C++14 TESTS 10 15 0
208546770 mbstu_beganer A June 5, 2023, 4:51 a.m. OK GNU C++14 TESTS 10 15 0
208546446 jiejiep A June 5, 2023, 4:46 a.m. OK GNU C++14 TESTS 10 15 0
208543728 RunTime_Error_21 A June 5, 2023, 4:02 a.m. OK GNU C++14 TESTS 10 15 0
208543231 Abdulla_Al_Noman A June 5, 2023, 3:54 a.m. OK GNU C++14 TESTS 10 15 0
208543129 Abdulla_Al_Noman A June 5, 2023, 3:52 a.m. OK GNU C++14 TESTS 10 15 0
208541866 BieHuiTou. A June 5, 2023, 3:29 a.m. OK GNU C++14 TESTS 10 15 0
208541269 hi_kito A June 5, 2023, 3:17 a.m. OK GNU C++14 TESTS 10 15 0
208540353 taikon A June 5, 2023, 3 a.m. OK GNU C++14 TESTS 10 15 0

remove filters

Back to search problems