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 |
---|---|---|---|---|---|---|
1817 | Codeforces Round 869 (Div. 1) | FINISHED | False | 8100 | 54487463 | April 29, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 269 ) | E | Half-sum | PROGRAMMING | divide and conquer greedy |
B"You're given a multiset of non-negative integers {a_1, a_2, ... , a_n } . In one step you take two elements x and y of the multiset, remove them and insert their mean value frac{x + y}{2} back into the multiset. You repeat the step described above until you are left with only two numbers A and B . What is the maximum possible value of their absolute difference |A-B| ? Since the answer is not an integer number, output it modulo 10^9+7 . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 100 ). Description of the test cases follows. The first line of each test case contains a single integer n ( 2 <= n <= 10^6 ) -- the size of the multiset. The second line contains n integers a_1, a_2, ldots, a_n ( 0 <= a_i <= 10^9 ) -- the elements of the multiset. It is guaranteed that the sum of n over all test cases does not exceed 10^6 . For each test case, output a single integer, the answer to the problem modulo 10^9+7 . Formally, let M = 10^9+7 . It can be shown that the answer can be expressed as an irreducible fraction frac{p}{q} , where p and q are integers and q not equiv 0 pmod{M} . Output the integer equal to p cdot q^{-1} bmod M . In other words, output an integer x such that 0 <= x < M and x cdot q equiv p pmod{M} . In the first case, you can't do any operations, so the answer is |7-3|=4 . In the second case, one of the optimal sequence of operations: In the third case, the exact answer is frac{3}{2} , and 500 ,000 ,005 cdot 2 equiv 3 pmod{10^9+7} . "... |
Codeforces Round #869 (Div.1, Div.2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
203970590 | rainboy | E | April 29, 2023, 6:48 p.m. | OK | GNU C11 | TESTS | 50 | 780 | 24064000 | ||
203949930 | fantasy | E | April 29, 2023, 4:21 p.m. | OK | GNU C++17 | TESTS | 50 | 810 | 18329600 | ||
203990078 | archiver | E | April 30, 2023, 12:57 a.m. | OK | GNU C++17 | TESTS | 50 | 1076 | 20377600 | ||
203956091 | scanhex | E | April 29, 2023, 4:43 p.m. | OK | GNU C++17 | TESTS | 50 | 1216 | 11059200 | ||
203996621 | zlc1114 | E | April 30, 2023, 3:34 a.m. | OK | GNU C++17 | TESTS | 50 | 2246 | 32256000 | ||
203962099 | Um_nik | E | April 29, 2023, 5:33 p.m. | OK | GNU C++17 | TESTS | 50 | 2729 | 20377600 | ||
203987561 | Sana | E | April 29, 2023, 11:46 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 296 | 20582400 | ||
204001172 | QAQAutoMaton | E | April 30, 2023, 5:07 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 358 | 44441600 | ||
203990042 | orzdevinwang | E | April 30, 2023, 12:56 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 420 | 100864000 | ||
203957504 | lqx2005 | E | April 29, 2023, 4:47 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 951 | 20070400 | ||
203987415 | chappy1 | E | April 29, 2023, 11:42 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 951 | 20070400 | ||
203980085 | Sana | E | April 29, 2023, 8:56 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 1107 | 25395200 | ||
203961750 | yzc2005 | E | April 29, 2023, 5:30 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 1169 | 21299200 | ||
203961533 | Toxel | E | April 29, 2023, 5:29 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 1372 | 12083200 | ||
203984105 | Sana | E | April 29, 2023, 10:21 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 1513 | 18227200 | ||
203961825 | yzc2005 | E | April 29, 2023, 5:31 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 1840 | 21299200 | ||
203948086 | ecnerwala | E | April 29, 2023, 4:14 p.m. | OK | GNU C++20 (64) | TESTS | 50 | 202 | 4403200 | ||
203963567 | BalintR | E | April 29, 2023, 5:44 p.m. | OK | GNU C++20 (64) | TESTS | 50 | 561 | 12083200 | ||
203996739 | mirror233 | E | April 30, 2023, 3:36 a.m. | OK | GNU C++20 (64) | TESTS | 50 | 576 | 24064000 | ||
203943737 | tourist | E | April 29, 2023, 3:58 p.m. | OK | GNU C++20 (64) | TESTS | 50 | 592 | 20172800 | ||
203975654 | maroonrk | E | April 29, 2023, 7:49 p.m. | OK | GNU C++20 (64) | TESTS | 50 | 748 | 66150400 | ||
204000104 | frodakcin | E | April 30, 2023, 4:44 a.m. | OK | GNU C++20 (64) | TESTS | 50 | 904 | 19763200 | ||
203976302 | 244mhq | E | April 29, 2023, 7:58 p.m. | OK | GNU C++20 (64) | TESTS | 50 | 1201 | 21094400 | ||
203947509 | A_G | E | April 29, 2023, 4:12 p.m. | OK | GNU C++20 (64) | TESTS | 50 | 1341 | 30310400 | ||
203961876 | jiangly | E | April 29, 2023, 5:31 p.m. | OK | GNU C++20 (64) | TESTS | 50 | 1465 | 24064000 | ||
203951990 | maspy | E | April 29, 2023, 4:28 p.m. | OK | GNU C++20 (64) | TESTS | 50 | 1700 | 85606400 |
Back to search problems