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 |
---|---|---|---|---|---|---|
1707 | Codeforces Round 808 (Div. 1) | FINISHED | False | 7200 | 79284263 | July 16, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 5857 ) | B | Difference Array | PROGRAMMING | brute force implementation math sortings |
B'You are given an array a consisting of n non-negative integers. It is guaranteed that a is sorted from small to large. For each operation, we generate a new array b_i=a_{i+1}-a_{i} for 1 <= i < n . Then we sort b from small to large, replace a with b , and decrease n by 1 . After performing n-1 operations, n becomes 1 . You need to output the only integer in array a (that is to say, you need to output a_1 ). The input consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains one integer n ( 2 <= n <= 10^5 ) -- the length of the array a . The second line contains n integers a_1,a_2, ... ,a_n ( 0 <= a_1 <= ldots <= a_n <= 5 cdot 10^5 ) -- the array a . It is guaranteed that the sum of n over all test cases does not exceed 2.5 cdot 10^5 , and the sum of a_n over all test cases does not exceed 5 cdot 10^5 . For each test case, output the answer on a new line. To simplify the notes, let operatorname{sort}(a) denote the array you get by sorting a from small to large. In the first test case, a=[1,10,100] at first. After the first operation, a= operatorname{sort}([10-1,100-10])=[9,90] . After the second operation, a= operatorname{sort}([90-9])=[81] . In the second test case, a=[4,8,9,13] at first. After the first operation, a= operatorname{sort}([8-4,9-8,13-9])=[1,4,4] . After the second operation, a= operatorname{sort}([4-1,4-4])=[0,3] . After the last operation, a= operatorname{sort}([3-0])=[3] . '... |
104930 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
164533731 | Cuellius | B | July 16, 2022, 5:47 p.m. | OK | C# 10 | TESTS | 30 | 249 | 18329600 | ||
164485452 | Gassa | B | July 16, 2022, 3:09 p.m. | OK | D | TESTS | 30 | 358 | 6144000 | ||
164576623 | meghanachitturi5678 | B | July 17, 2022, 6 a.m. | OK | GNU C11 | TESTS | 31 | 77 | 1228800 | ||
164523945 | chro4896 | B | July 16, 2022, 4:28 p.m. | OK | GNU C11 | TESTS | 30 | 78 | 4403200 | ||
164466849 | SeiunSky | B | July 16, 2022, 2:48 p.m. | OK | GNU C++14 | TESTS | 30 | 31 | 921600 | ||
164554025 | joke3579 | B | July 16, 2022, 11:30 p.m. | OK | GNU C++14 | TESTS | 31 | 31 | 921600 | ||
164559215 | win10 | B | July 17, 2022, 1:34 a.m. | OK | GNU C++14 | TESTS | 31 | 31 | 2560000 | ||
164498673 | Winterfrost | B | July 16, 2022, 3:30 p.m. | OK | GNU C++14 | TESTS | 30 | 31 | 3379200 | ||
164496267 | ZhangCW_QwQ | B | July 16, 2022, 3:26 p.m. | OK | GNU C++14 | TESTS | 30 | 31 | 5324800 | ||
164478669 | CE_WA_TLE | B | July 16, 2022, 3 p.m. | OK | GNU C++14 | TESTS | 30 | 31 | 9625600 | ||
164485803 | IcMtr | B | July 16, 2022, 3:10 p.m. | OK | GNU C++14 | TESTS | 30 | 46 | 409600 | ||
164565679 | xianrui5891 | B | July 17, 2022, 3:11 a.m. | OK | GNU C++14 | TESTS | 31 | 46 | 409600 | ||
164574237 | 1390632669 | B | July 17, 2022, 5:27 a.m. | OK | GNU C++14 | TESTS | 31 | 46 | 1126400 | ||
164480209 | laundaryman | B | July 16, 2022, 3:02 p.m. | OK | GNU C++14 | TESTS | 30 | 46 | 2867200 | ||
164469178 | -imc- | B | July 16, 2022, 2:50 p.m. | OK | GNU C++17 | TESTS | 30 | 46 | 409600 | ||
164531322 | you_can_code | B | July 16, 2022, 5:27 p.m. | OK | GNU C++17 | TESTS | 30 | 46 | 512000 | ||
164494422 | ooaa | B | July 16, 2022, 3:23 p.m. | OK | GNU C++17 | TESTS | 30 | 46 | 716800 | ||
164485030 | EricQian | B | July 16, 2022, 3:09 p.m. | OK | GNU C++17 | TESTS | 30 | 46 | 1126400 | ||
164497562 | lddlinan | B | July 16, 2022, 3:28 p.m. | OK | GNU C++17 | TESTS | 30 | 46 | 1945600 | ||
164533027 | RandomLB | B | July 16, 2022, 5:41 p.m. | OK | GNU C++17 | TESTS | 30 | 61 | 307200 | ||
164512929 | Hany01 | B | July 16, 2022, 4:01 p.m. | OK | GNU C++17 | TESTS | 30 | 61 | 409600 | ||
164496942 | anodiebird | B | July 16, 2022, 3:27 p.m. | OK | GNU C++17 | TESTS | 30 | 61 | 1638400 | ||
164523914 | LuoShaoyinn | B | July 16, 2022, 4:28 p.m. | OK | GNU C++17 | TESTS | 30 | 61 | 2764800 | ||
164575295 | psc233 | B | July 17, 2022, 5:42 a.m. | OK | GNU C++17 | TESTS | 31 | 62 | 409600 | ||
164502536 | EnAnimant | B | July 16, 2022, 3:38 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 31 | 409600 | ||
164501910 | EIKOU | B | July 16, 2022, 3:36 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 31 | 409600 | ||
164526034 | Freedom__King | B | July 16, 2022, 4:33 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 31 | 1331200 | ||
164546850 | over_flow | B | July 16, 2022, 8:32 p.m. | OK | GNU C++17 (64) | TESTS | 31 | 31 | 1433600 | ||
164476251 | LayCurse | B | July 16, 2022, 2:58 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 31 | 99123200 | ||
164496680 | potato167 | B | July 16, 2022, 3:27 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 46 | 409600 | ||
164489894 | JaroslavUrban | B | July 16, 2022, 3:15 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 46 | 409600 | ||
164488209 | AutumnKite | B | July 16, 2022, 3:13 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 46 | 409600 | ||
164499106 | propane | B | July 16, 2022, 3:31 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 46 | 409600 | ||
164555637 | DOngPH19 | B | July 17, 2022, 12:19 a.m. | OK | GNU C++17 (64) | TESTS | 31 | 46 | 409600 | ||
164506501 | ultizet | B | July 16, 2022, 3:46 p.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 409600 | ||
164472236 | ecnerwala | B | July 16, 2022, 2:53 p.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 409600 | ||
164540011 | aggressor_ | B | July 16, 2022, 6:52 p.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 409600 | ||
164514349 | w-- | B | July 16, 2022, 4:04 p.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 409600 | ||
164549303 | dranjohn | B | July 16, 2022, 9:21 p.m. | OK | GNU C++20 (64) | TESTS | 31 | 31 | 819200 | ||
164466783 | Ormlis | B | July 16, 2022, 2:48 p.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 1126400 | ||
164529873 | NguyenDangQuan | B | July 16, 2022, 5:18 p.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 1228800 | ||
164516385 | monstersqaq | B | July 16, 2022, 4:09 p.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 1638400 | ||
164488400 | njwrz | B | July 16, 2022, 3:13 p.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 1638400 | ||
164504331 | Kniaz | B | July 16, 2022, 3:41 p.m. | OK | GNU C++20 (64) | TESTS | 30 | 31 | 2150400 | ||
164496125 | profchi | B | July 16, 2022, 3:26 p.m. | OK | Java 11 | TESTS | 30 | 280 | 0 | ||
164566984 | Wuya | B | July 17, 2022, 3:30 a.m. | OK | Java 11 | TESTS | 31 | 342 | 0 | ||
164575346 | jlalba | B | July 17, 2022, 5:43 a.m. | OK | Java 17 | TESTS | 31 | 436 | 512000 | ||
164496587 | AndreySiunov | B | July 16, 2022, 3:26 p.m. | OK | Java 8 | TESTS | 30 | 170 | 0 | ||
164518692 | reborn_chris | B | July 16, 2022, 4:15 p.m. | OK | Java 8 | TESTS | 30 | 186 | 0 | ||
164513161 | cc4414 | B | July 16, 2022, 4:01 p.m. | OK | Java 8 | TESTS | 30 | 187 | 0 | ||
164500881 | Frank0628 | B | July 16, 2022, 3:34 p.m. | OK | Java 8 | TESTS | 30 | 248 | 0 | ||
164520153 | golions | B | July 16, 2022, 4:19 p.m. | OK | Java 8 | TESTS | 30 | 358 | 0 | ||
164489046 | SaveVMK | B | July 16, 2022, 3:14 p.m. | OK | Java 8 | TESTS | 30 | 499 | 0 | ||
164493138 | Hakiobo | B | July 16, 2022, 3:20 p.m. | OK | Kotlin 1.4 | TESTS | 30 | 218 | 0 | ||
164529483 | titia | B | July 16, 2022, 5:16 p.m. | OK | PyPy 3 | TESTS | 30 | 264 | 10752000 | ||
164485540 | eepsilon | B | July 16, 2022, 3:09 p.m. | OK | PyPy 3 | TESTS | 30 | 265 | 13004800 | ||
164531447 | anishde85 | B | July 16, 2022, 5:28 p.m. | OK | PyPy 3 | TESTS | 30 | 358 | 212172800 | ||
164549138 | Ghooster | B | July 16, 2022, 9:18 p.m. | OK | PyPy 3-64 | TESTS | 31 | 140 | 16691200 | ||
164540517 | KanishkGoel | B | July 16, 2022, 6:58 p.m. | OK | PyPy 3-64 | TESTS | 30 | 140 | 17305600 | ||
164538954 | hkwu6013 | B | July 16, 2022, 6:39 p.m. | OK | PyPy 3-64 | TESTS | 30 | 156 | 20992000 | ||
164508085 | plevande | B | July 16, 2022, 3:49 p.m. | OK | PyPy 3-64 | TESTS | 30 | 171 | 10444800 | ||
164540690 | shobonvip | B | July 16, 2022, 7 p.m. | OK | PyPy 3-64 | TESTS | 30 | 187 | 18534400 | ||
164499455 | siganai | B | July 16, 2022, 3:32 p.m. | OK | PyPy 3-64 | TESTS | 30 | 202 | 15974400 | ||
164469845 | asdsasd | B | July 16, 2022, 2:51 p.m. | OK | PyPy 3-64 | TESTS | 30 | 202 | 24678400 | ||
164572214 | shiviDON | B | July 17, 2022, 4:56 a.m. | OK | PyPy 3-64 | TESTS | 31 | 217 | 19353600 | ||
164529916 | oadey89 | B | July 16, 2022, 5:18 p.m. | OK | PyPy 3-64 | TESTS | 30 | 249 | 15462400 | ||
164537165 | hkwu6013 | B | July 16, 2022, 6:19 p.m. | OK | PyPy 3-64 | TESTS | 30 | 280 | 15052800 | ||
164486136 | magnus.hegdahl | B | July 16, 2022, 3:10 p.m. | OK | Rust 2021 | TESTS | 30 | 31 | 1126400 | ||
164467975 | sansen | B | July 16, 2022, 2:49 p.m. | OK | Rust 2021 | TESTS | 30 | 46 | 4198400 | ||
164499952 | LittleFall | B | July 16, 2022, 3:33 p.m. | OK | Rust 2021 | TESTS | 30 | 46 | 8396800 | ||
164571942 | Svlad_Cjelli | B | July 17, 2022, 4:52 a.m. | OK | Rust 2021 | TESTS | 31 | 77 | 1024000 | ||
164490461 | Russell_Emerine | B | July 16, 2022, 3:16 p.m. | OK | Rust 2021 | TESTS | 30 | 93 | 8806400 |
Back to search problems