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 |
---|---|---|---|---|---|---|
1909 | Pinely Round 3 (Div. 1 + Div. 2) | FINISHED | False | 10800 | 28481099 | Dec. 23, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 4484 ) | D | Split Plus K | PROGRAMMING | greedy math number theory |
B'There are n positive integers a_1, a_2, ... , a_n on a blackboard. You are also given a positive integer k . You can perform the following operation some (possibly 0 ) times: Is it possible to make all the numbers on the blackboard equal? If yes, what is the minimum number of operations you need? Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). The description of the test cases follows. The first line of each test case contains two integers n , k ( 1 <= n <= 2 cdot 10^5 , 1 <= q k <= q 10^{12} ) -- the number of integers initially on the blackboard and the constant k . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^{12} ) -- the initial state of the blackboard. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a single line containing an integer: the minimum number of operations you need to make all the numbers on the blackboard equal, or -1 if it is impossible. In the first test case, k = 1 . You can make all the numbers on the blackboard equal to 2 with the following operations: This makes all the numbers equal in 3 operations. It can be shown that you cannot make all the numbers equal in less than 3 operations. In the second test case, k = 3 . You can make all the numbers on the blackboard equal to 7 with the following operation: In the third test case, k = 10 . You can make all the numbers on the blackboard equal to 40 with the following operations: In the fourth and in the fifth test case, you can show that it is impossible to make all the numbers on the blackboard equal. '... |
Editorial of Pinely Round 3 (Div. 1 + Div. 2) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
238600097 | Gassa | D | Dec. 23, 2023, 7:55 p.m. | OK | D | TESTS | 27 | 155 | 17203200 | ||
238614631 | UraykevoliQwQ | D | Dec. 24, 2023, 2:31 a.m. | OK | GNU C++14 | TESTS | 27 | 78 | 2662400 | ||
238625582 | mwzqwq | D | Dec. 24, 2023, 5:50 a.m. | OK | GNU C++14 | TESTS | 27 | 93 | 2662400 | ||
238624381 | M998244353 | D | Dec. 24, 2023, 5:34 a.m. | OK | GNU C++14 | TESTS | 27 | 93 | 2662400 | ||
238619482 | DangPhuDuy | D | Dec. 24, 2023, 4:15 a.m. | OK | GNU C++14 | TESTS | 27 | 93 | 2662400 | ||
238619220 | atbottom | D | Dec. 24, 2023, 4:10 a.m. | OK | GNU C++14 | TESTS | 27 | 93 | 2662400 | ||
238619192 | kuguadawang | D | Dec. 24, 2023, 4:10 a.m. | OK | GNU C++14 | TESTS | 27 | 93 | 2662400 | ||
238618810 | taghmh | D | Dec. 24, 2023, 4:03 a.m. | OK | GNU C++14 | TESTS | 27 | 93 | 2662400 | ||
238617072 | lsroi | D | Dec. 24, 2023, 3:30 a.m. | OK | GNU C++14 | TESTS | 27 | 93 | 2662400 | ||
238614624 | ArcaLunar | D | Dec. 24, 2023, 2:31 a.m. | OK | GNU C++14 | TESTS | 27 | 93 | 2662400 | ||
238612817 | -LAP- | D | Dec. 24, 2023, 1:43 a.m. | OK | GNU C++14 | TESTS | 27 | 93 | 2662400 | ||
238597031 | pmmitkovv | D | Dec. 23, 2023, 7:14 p.m. | OK | GNU C++17 | TESTS | 27 | 78 | 2662400 | ||
238618531 | SLPing | D | Dec. 24, 2023, 3:58 a.m. | OK | GNU C++17 | TESTS | 27 | 93 | 1024000 | ||
238625722 | uxinglaohu | D | Dec. 24, 2023, 5:52 a.m. | OK | GNU C++17 | TESTS | 27 | 93 | 2662400 | ||
238624806 | random-coder | D | Dec. 24, 2023, 5:39 a.m. | OK | GNU C++17 | TESTS | 27 | 93 | 2662400 | ||
238620543 | MOHD_FAIZ | D | Dec. 24, 2023, 4:36 a.m. | OK | GNU C++17 | TESTS | 27 | 93 | 2662400 | ||
238616968 | Xiaozzz | D | Dec. 24, 2023, 3:27 a.m. | OK | GNU C++17 | TESTS | 27 | 93 | 2662400 | ||
238613875 | peepdamonster | D | Dec. 24, 2023, 2:14 a.m. | OK | GNU C++17 | TESTS | 27 | 93 | 2662400 | ||
238610865 | serenemind | D | Dec. 24, 2023, 12:27 a.m. | OK | GNU C++17 | TESTS | 27 | 93 | 2662400 | ||
238609541 | gam_bit | D | Dec. 23, 2023, 11:30 p.m. | OK | GNU C++17 | TESTS | 27 | 93 | 2662400 | ||
238605057 | The_Special_One | D | Dec. 23, 2023, 9:19 p.m. | OK | GNU C++17 | TESTS | 27 | 93 | 2662400 | ||
238579304 | Remilia1023 | D | Dec. 23, 2023, 5:06 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 31 | 3379200 | ||
238576425 | Hackenbush | D | Dec. 23, 2023, 4:56 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 31 | 8499200 | ||
238617542 | robinyqc | D | Dec. 24, 2023, 3:39 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 46 | 2867200 | ||
238621974 | Llinhao | D | Dec. 24, 2023, 5 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 61 | 2867200 | ||
238604837 | Gladiator_King | D | Dec. 23, 2023, 9:14 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 61 | 2867200 | ||
238623695 | Once_I_Liked_AGirl | D | Dec. 24, 2023, 5:24 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 62 | 2867200 | ||
238623168 | Lawali | D | Dec. 24, 2023, 5:17 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 62 | 2867200 | ||
238622951 | serialcomder | D | Dec. 24, 2023, 5:14 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 62 | 2867200 | ||
238621147 | maomao90 | D | Dec. 24, 2023, 4:45 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 62 | 2867200 | ||
238619961 | Moyou | D | Dec. 24, 2023, 4:25 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 62 | 2867200 | ||
238582481 | marc2825 | D | Dec. 23, 2023, 5:18 p.m. | OK | GNU C++20 (64) | TESTS | 27 | 15 | 2969600 | ||
238584738 | ForbiddenCider | D | Dec. 23, 2023, 5:26 p.m. | OK | GNU C++20 (64) | TESTS | 27 | 31 | 19251200 | ||
238608000 | opPO | D | Dec. 23, 2023, 10:35 p.m. | OK | GNU C++20 (64) | TESTS | 27 | 46 | 1228800 | ||
238626401 | prefixsumenjoyer23 | D | Dec. 24, 2023, 6 a.m. | OK | GNU C++20 (64) | TESTS | 27 | 46 | 2867200 | ||
238625976 | RohamOmidi | D | Dec. 24, 2023, 5:55 a.m. | OK | GNU C++20 (64) | TESTS | 27 | 46 | 2867200 | ||
238625313 | HTyin | D | Dec. 24, 2023, 5:46 a.m. | OK | GNU C++20 (64) | TESTS | 27 | 46 | 2867200 | ||
238624893 | Jin-Keeper | D | Dec. 24, 2023, 5:41 a.m. | OK | GNU C++20 (64) | TESTS | 27 | 46 | 2867200 | ||
238624741 | qiu_tianhan | D | Dec. 24, 2023, 5:39 a.m. | OK | GNU C++20 (64) | TESTS | 27 | 46 | 2867200 | ||
238624097 | pro_harshit | D | Dec. 24, 2023, 5:29 a.m. | OK | GNU C++20 (64) | TESTS | 27 | 46 | 2867200 | ||
238623914 | wuyoudexian | D | Dec. 24, 2023, 5:27 a.m. | OK | GNU C++20 (64) | TESTS | 27 | 46 | 2867200 | ||
238603030 | CutSandstone | D | Dec. 23, 2023, 8:42 p.m. | OK | Java 17 | TESTS | 27 | 249 | 44646400 | ||
238584175 | tushar19280 | D | Dec. 23, 2023, 5:24 p.m. | OK | Java 17 | TESTS | 27 | 483 | 119398400 | ||
238615749 | coderman2004 | D | Dec. 24, 2023, 2:58 a.m. | OK | Java 8 | TESTS | 27 | 280 | 36147200 | ||
238592125 | aditya888 | D | Dec. 23, 2023, 6:26 p.m. | OK | Java 8 | TESTS | 27 | 327 | 35123200 | ||
238587008 | ahtoh_ | D | Dec. 23, 2023, 5:33 p.m. | OK | Node.js | TESTS | 27 | 265 | 65638400 | ||
238591388 | k_ano | D | Dec. 23, 2023, 6:21 p.m. | OK | PyPy 3 | TESTS | 27 | 686 | 43008000 | ||
238600175 | DRDIV | D | Dec. 23, 2023, 7:56 p.m. | OK | PyPy 3-64 | TESTS | 27 | 186 | 64512000 | ||
238602163 | SamuelTull | D | Dec. 23, 2023, 8:28 p.m. | OK | PyPy 3-64 | TESTS | 27 | 187 | 57241600 | ||
238602989 | yaroslav_pos | D | Dec. 23, 2023, 8:41 p.m. | OK | PyPy 3-64 | TESTS | 27 | 187 | 57958400 | ||
238599362 | AyuAnchor | D | Dec. 23, 2023, 7:45 p.m. | OK | PyPy 3-64 | TESTS | 27 | 187 | 57958400 | ||
238610013 | RobinFromTheHood | D | Dec. 23, 2023, 11:50 p.m. | OK | PyPy 3-64 | TESTS | 27 | 187 | 59392000 | ||
238576551 | aPNJ777 | D | Dec. 23, 2023, 4:56 p.m. | OK | PyPy 3-64 | TESTS | 27 | 202 | 56115200 | ||
238594357 | ManojkumarPatanik | D | Dec. 23, 2023, 6:45 p.m. | OK | PyPy 3-64 | TESTS | 27 | 202 | 57241600 | ||
238592114 | titia | D | Dec. 23, 2023, 6:26 p.m. | OK | PyPy 3-64 | TESTS | 27 | 202 | 57241600 | ||
238589816 | tahuruzzoha | D | Dec. 23, 2023, 6:12 p.m. | OK | PyPy 3-64 | TESTS | 27 | 202 | 57856000 | ||
238591052 | PFT | D | Dec. 23, 2023, 6:19 p.m. | OK | PyPy 3-64 | TESTS | 27 | 202 | 62361600 | ||
238583492 | qqx | D | Dec. 23, 2023, 5:22 p.m. | OK | Python 3 | TESTS | 27 | 374 | 34508800 |
Back to search problems