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 |
---|---|---|---|---|---|---|
1781 | VK Cup 2022 - Отборочный раунд (Engine) | FINISHED | False | 10800 | 63395662 | Jan. 15, 2023, 12:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 5634 ) | D | Many Perfect Squares | PROGRAMMING | brute force math number theory |
B'You are given a set a_1, a_2, ldots, a_n of distinct positive integers. We define the squareness of an integer x as the number of perfect squares among the numbers a_1 + x, a_2 + x, ldots, a_n + x . Find the maximum squareness among all integers x between 0 and 10^{18} , inclusive. Perfect squares are integers of the form t^2 , where t is a non-negative integer. The smallest perfect squares are 0, 1, 4, 9, 16, ldots . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 50 ). The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 50 ) -- the size of the set. The second line contains n distinct integers a_1, a_2, ldots, a_n in increasing order ( 1 <= a_1 < a_2 < ldots < a_n <= 10^9 ) -- the set itself. It is guaranteed that the sum of n over all test cases does not exceed 50 . For each test case, print a single integer -- the largest possible number of perfect squares among a_1 + x, a_2 + x, ldots, a_n + x , for some 0 <= x <= 10^{18} . In the first test case, for x = 0 the set contains two perfect squares: 1 and 4 . It is impossible to obtain more than two perfect squares. In the second test case, for x = 3 the set looks like 4, 9, 16, 25, 100 , that is, all its elements are perfect squares. '... |
Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
189315696 | Gassa | D | Jan. 15, 2023, 12:26 p.m. | OK | D | TESTS | 121 | 1123 | 0 | ||
189393411 | YeahPotato | D | Jan. 16, 2023, 3:45 a.m. | OK | GNU C++14 | TESTS | 121 | 124 | 106905600 | ||
189386101 | sprads | D | Jan. 16, 2023, 12:11 a.m. | OK | GNU C++14 | TESTS | 121 | 390 | 0 | ||
189323409 | TeaPot | D | Jan. 15, 2023, 12:48 p.m. | OK | GNU C++14 | TESTS | 121 | 436 | 102400 | ||
189395760 | cgz2006 | D | Jan. 16, 2023, 4:36 a.m. | OK | GNU C++14 | TESTS | 121 | 514 | 0 | ||
189395779 | cgz2006 | D | Jan. 16, 2023, 4:36 a.m. | OK | GNU C++14 | TESTS | 121 | 530 | 0 | ||
189336842 | Igor_Parfenov | D | Jan. 15, 2023, 1:37 p.m. | OK | GNU C++14 | TESTS | 121 | 717 | 102400 | ||
189388912 | an_interesting_name | D | Jan. 16, 2023, 1:57 a.m. | OK | GNU C++14 | TESTS | 121 | 811 | 9932800 | ||
189386078 | sprads | D | Jan. 16, 2023, 12:09 a.m. | OK | GNU C++14 | TESTS | 121 | 3478 | 0 | ||
189325305 | antonis.white | D | Jan. 15, 2023, 12:54 p.m. | OK | GNU C++17 | TESTS | 121 | 78 | 7987200 | ||
189328654 | Loading. | D | Jan. 15, 2023, 1:05 p.m. | OK | GNU C++17 | TESTS | 121 | 109 | 614400 | ||
189324330 | Tima | D | Jan. 15, 2023, 12:51 p.m. | OK | GNU C++17 | TESTS | 121 | 124 | 14336000 | ||
189339314 | Edvard | D | Jan. 15, 2023, 1:47 p.m. | OK | GNU C++17 | TESTS | 121 | 171 | 1945600 | ||
189336227 | Svyat | D | Jan. 15, 2023, 1:34 p.m. | OK | GNU C++17 | TESTS | 121 | 187 | 8806400 | ||
189347057 | limage | D | Jan. 15, 2023, 2:21 p.m. | OK | GNU C++17 | TESTS | 121 | 280 | 204800 | ||
189329897 | TolyaHo | D | Jan. 15, 2023, 1:10 p.m. | OK | GNU C++17 | TESTS | 121 | 296 | 16588800 | ||
189332599 | ultizet | D | Jan. 15, 2023, 1:20 p.m. | OK | GNU C++17 | TESTS | 121 | 312 | 102400 | ||
189318626 | shnirelman | D | Jan. 15, 2023, 12:34 p.m. | OK | GNU C++17 | TESTS | 121 | 327 | 204800 | ||
189320367 | vepifanov | D | Jan. 15, 2023, 12:39 p.m. | OK | GNU C++17 | TESTS | 121 | 327 | 11878400 | ||
189330642 | glebustim | D | Jan. 15, 2023, 1:12 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 78 | 307200 | ||
189330767 | BlackAnt | D | Jan. 15, 2023, 1:13 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 78 | 7372800 | ||
189338117 | Absurd_ | D | Jan. 15, 2023, 1:42 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 93 | 512000 | ||
189354927 | awoo | D | Jan. 15, 2023, 2:56 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 171 | 0 | ||
189322642 | ALILILILILI-KHAN | D | Jan. 15, 2023, 12:46 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 187 | 0 | ||
189317245 | Kirill22 | D | Jan. 15, 2023, 12:30 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 234 | 0 | ||
189333881 | AndreyC | D | Jan. 15, 2023, 1:25 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 249 | 0 | ||
189333175 | chaichunyang | D | Jan. 15, 2023, 1:22 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 249 | 0 | ||
189329774 | HCPS42 | D | Jan. 15, 2023, 1:09 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 249 | 0 | ||
189323577 | Siberian | D | Jan. 15, 2023, 12:49 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 249 | 0 | ||
189327691 | zeliboba | D | Jan. 15, 2023, 1:02 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 61 | 39628800 | ||
189318210 | Maksim1744 | D | Jan. 15, 2023, 12:33 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 62 | 0 | ||
189317844 | Allvik06 | D | Jan. 15, 2023, 12:31 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 62 | 0 | ||
189324957 | maxplus | D | Jan. 15, 2023, 12:53 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 62 | 7372800 | ||
189333364 | Zhukov_Dmitry | D | Jan. 15, 2023, 1:23 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 77 | 0 | ||
189341554 | an_na | D | Jan. 15, 2023, 1:57 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 78 | 0 | ||
189317100 | Ormlis | D | Jan. 15, 2023, 12:30 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 78 | 7372800 | ||
189327630 | amethyst0 | D | Jan. 15, 2023, 1:02 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 93 | 1126400 | ||
189331961 | ak-group | D | Jan. 15, 2023, 1:17 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 109 | 0 | ||
189318457 | Petr | D | Jan. 15, 2023, 12:33 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 109 | 0 | ||
189329685 | mmaxio | D | Jan. 15, 2023, 1:09 p.m. | OK | Java 11 | TESTS | 121 | 405 | 29388800 | ||
189342848 | DarLam | D | Jan. 15, 2023, 2:03 p.m. | OK | Java 11 | TESTS | 121 | 920 | 86425600 | ||
189328964 | knightL | D | Jan. 15, 2023, 1:06 p.m. | OK | Java 11 | TESTS | 121 | 1107 | 18636800 | ||
189329917 | iakovlev.zakhar | D | Jan. 15, 2023, 1:10 p.m. | OK | Java 8 | TESTS | 121 | 1388 | 35942400 | ||
189323544 | darnley | D | Jan. 15, 2023, 12:48 p.m. | OK | Kotlin 1.7 | TESTS | 121 | 982 | 47820800 | ||
189343025 | ktropin | D | Jan. 15, 2023, 2:03 p.m. | OK | Mono C# | TESTS | 121 | 826 | 45977600 | ||
189341370 | IlyinAD | D | Jan. 15, 2023, 1:56 p.m. | OK | MS C++ 2017 | TESTS | 121 | 499 | 0 | ||
189346577 | mandalorichick | D | Jan. 15, 2023, 2:19 p.m. | OK | PyPy 3 | TESTS | 121 | 717 | 78233600 | ||
189318767 | Egor | D | Jan. 15, 2023, 12:34 p.m. | OK | Rust 2021 | TESTS | 121 | 140 | 8704000 |
Back to search problems