| # | User | Rating |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3382 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3312 |
| 10 | idontwannadothis…e | 3191 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 155 |
| 2 | nik_exists | 151 |
| 3 | maspy | 149 |
| 4 | AmShZ | 145 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | BledDest | 136 |
| 8 | adamant | 134 |
| 9 | maroonrk | 132 |
| 10 | cry | 130 |
|
0
TheScrasse, is it an error? Problem I — 1900! |
|
-8
Thanks |
|
-8
Unordered map is constant time right, why is that giving TLE Is it because the constant is higher for the test case. Clarify if you can why this code gave TLE 263947136 |
|
+1
Consider an array of numbers $$$a_{1}, a_2, ..., a_n$$$. Let $$$g$$$ be the greatest common divisor (gcd) of all these numbers. Since every number is a multiple of $$$g$$$, we can express each number as follows: $$$a_1 = g * k_1$$$ $$$a_2 = g * k_2$$$ ... $$$a_n = g * k_n$$$ where $$$k_1, k_2, ..., k_n$$$ are positive integers. The sum of these numbers is: $$$a_1 + a_2 + ... + a_n = g * (k_1 + k_2 + ... + k_n) = x$$$ Therefore, $$$g$$$ should be a factor of $$$x$$$. And here all $$$k_i$$$'s are positive integers so $$$\sum k_i \geq n$$$ hence we have to find smallest factor of $$$x$$$ that is greater that or equal to $$$n$$$ ,say $$$f$$$ Then $$$x/f$$$ is our required $$$g$$$ |
| Name |
|---|


