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 |
---|---|---|---|---|---|---|
1968 | Codeforces Round 943 (Div. 3) | FINISHED | False | 8100 | 17162099 | May 2, 2024, 2:45 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 10461 ) | E | Cells Arrangement | PROGRAMMING | constructive algorithms | 1600 |
B'You are given an integer n . You choose n cells (x_1,y_1), (x_2,y_2), ... ,(x_n,y_n) in the grid n x n where 1 <= x_i <= n and 1 <= y_i <= n . Let mathcal{H} be the set of distinct Manhattan distances between any pair of cells. Your task is to maximize the size of mathcal{H} . Examples of sets and their construction are given in the notes. If there exists more than one solution, you are allowed to output any. Manhattan distance between cells (x_1,y_1) and (x_2,y_2) equals |x_1-x_2|+|y_1-y_2| . The first line contains a single integer t ( 1 <= t <= 50 ) -- the number of test cases. Each of the following t lines contains a single integer n ( 2 <= n <= 10^3 ). For each test case, output n points which maximize the size of mathcal{H} . It is not necessary to output an empty line at the end of the answer for each test case. In the first testcase we have n=2 . One of the possible arrangements is: In the second testcase we have n=3 . The optimal arrangement is: mathcal{H} = {|2-2|+|1-1|,|2-2|+|3-3|,|3-3|+|1-1|,|2-2|+|1-3|,|2-3|+|1-1|,|2-3|+|3-1| } = {0,0,0,2,1,3 } = {0,1,2,3 } . For n=4 a possible arrangement is: For n=5 a possible arrangement is: For n=6 a possible arrangement is: '... |
129096 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
263632642 | CF_xyy | E | June 1, 2024, 1:03 p.m. | OK | C++14 (GCC 6-32) | TESTS | 13 | 46 | 0 | 1600 | |
263014035 | ImEquilibrium | E | May 28, 2024, 1 p.m. | OK | C++14 (GCC 6-32) | TESTS | 13 | 46 | 0 | 1600 | |
261720815 | luogu_bot3 | E | May 20, 2024, 4:26 a.m. | OK | C++14 (GCC 6-32) | TESTS | 13 | 46 | 0 | 1600 | |
261272240 | luogu_bot5 | E | May 17, 2024, 4:01 a.m. | OK | C++14 (GCC 6-32) | TESTS | 13 | 46 | 0 | 1600 | |
261270845 | Cinnaki | E | May 17, 2024, 3:39 a.m. | OK | C++14 (GCC 6-32) | TESTS | 13 | 46 | 0 | 1600 | |
261203296 | RemberMe | E | May 16, 2024, 1:30 p.m. | OK | C++14 (GCC 6-32) | TESTS | 13 | 46 | 0 | 1600 | |
261098278 | spacedate_xacs | E | May 15, 2024, 7:27 p.m. | OK | C++14 (GCC 6-32) | TESTS | 13 | 46 | 0 | 1600 | |
262981380 | sscsscssc | E | May 28, 2024, 8:28 a.m. | OK | C++14 (GCC 6-32) | TESTS | 13 | 46 | 102400 | 1600 | |
262343686 | WaterSun | E | May 24, 2024, 6:38 a.m. | OK | C++14 (GCC 6-32) | TESTS | 13 | 46 | 102400 | 1600 | |
262807196 | Rombing | E | May 26, 2024, 10:57 p.m. | OK | C++14 (GCC 6-32) | TESTS | 13 | 46 | 3174400 | 1600 | |
263681487 | dlebryk | E | June 1, 2024, 9:14 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | 1600 | |
263670569 | asmitdeb | E | June 1, 2024, 6:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | 1600 | |
263618828 | bleedin_maroon | E | June 1, 2024, 11:10 a.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | 1600 | |
263609093 | elotelo10 | E | June 1, 2024, 9:52 a.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | 1600 | |
263259516 | Taekki | E | May 30, 2024, 1:58 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | 1600 | |
263151967 | wakakaka | E | May 29, 2024, 1:56 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | 1600 | |
263069549 | SeaUrc | E | May 28, 2024, 10:46 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | 1600 | |
263054573 | KickBlitz | E | May 28, 2024, 6:42 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | 1600 | |
263053082 | randomguy999 | E | May 28, 2024, 6:27 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | 1600 | |
263052565 | HarshitSPakhariya | E | May 28, 2024, 6:23 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | 1600 | |
263690435 | onestig | E | June 2, 2024, 1:42 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | 1600 | |
263636940 | modemingzi_ | E | June 1, 2024, 1:40 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | 1600 | |
263421050 | mittalshivam_2709 | E | May 31, 2024, 6:24 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | 1600 | |
263396281 | Akkotsu | E | May 31, 2024, 1:07 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | 1600 | |
263248765 | Timosh | E | May 30, 2024, 12:38 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | 1600 | |
263127653 | pcm_op | E | May 29, 2024, 10:44 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | 1600 | |
263089247 | Sariel_snow | E | May 29, 2024, 5:21 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | 1600 | |
263056617 | sdKrhMn286 | E | May 28, 2024, 7:05 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | 1600 | |
263041895 | AlexTheFirelord | E | May 28, 2024, 4:45 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | 1600 | |
263022916 | Rinkawaii | E | May 28, 2024, 2:11 p.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | 1600 | |
261076947 | Martynas | E | May 15, 2024, 3:48 p.m. | OK | Go | TESTS | 13 | 62 | 716800 | 1600 | |
261229626 | october_rain | E | May 16, 2024, 4:51 p.m. | OK | Haskell | TESTS | 13 | 108 | 0 | 1600 | |
261303803 | mohit1510 | E | May 17, 2024, 9:09 a.m. | OK | Java 21 | TESTS | 13 | 249 | 307200 | 1600 | |
261076112 | c1415926 | E | May 15, 2024, 3:40 p.m. | OK | Java 21 | TESTS | 13 | 249 | 512000 | 1600 | |
261248784 | Sagy13 | E | May 16, 2024, 7:57 p.m. | OK | Java 21 | TESTS | 13 | 265 | 614400 | 1600 | |
262000669 | BishtCoder | E | May 21, 2024, 10:46 a.m. | OK | Java 21 | TESTS | 13 | 280 | 716800 | 1600 | |
261667503 | gaju_01 | E | May 19, 2024, 2:51 p.m. | OK | Java 21 | TESTS | 13 | 280 | 1024000 | 1600 | |
262705010 | AKhacks | E | May 26, 2024, 12:43 p.m. | OK | Java 21 | TESTS | 13 | 281 | 819200 | 1600 | |
261776303 | anshgrover25072002 | E | May 20, 2024, 12:15 p.m. | OK | Java 21 | TESTS | 13 | 296 | 716800 | 1600 | |
263587566 | A_R_I_F | E | June 1, 2024, 6:54 a.m. | OK | Java 21 | TESTS | 13 | 328 | 716800 | 1600 | |
263089380 | Sariel_snow | E | May 29, 2024, 5:23 a.m. | OK | Java 21 | TESTS | 13 | 343 | 1126400 | 1600 | |
263526048 | NavneetKumar123 | E | May 31, 2024, 4:27 p.m. | OK | Java 21 | TESTS | 13 | 374 | 1638400 | 1600 | |
263584822 | HardikG12 | E | June 1, 2024, 6:32 a.m. | OK | Java 8 | TESTS | 13 | 155 | 0 | 1600 | |
261303060 | Hemant_malav | E | May 17, 2024, 9:02 a.m. | OK | Java 8 | TESTS | 13 | 155 | 8499200 | 1600 | |
261165695 | Sumitsingh7 | E | May 16, 2024, 8:31 a.m. | OK | Java 8 | TESTS | 13 | 327 | 6553600 | 1600 | |
263010296 | parth_7042 | E | May 28, 2024, 12:31 p.m. | OK | PHP | TESTS | 13 | 139 | 0 | 1600 | |
261704400 | mahnameisayush | E | May 19, 2024, 9:32 p.m. | OK | PyPy 3 | TESTS | 13 | 186 | 9216000 | 1600 | |
262696371 | NitroSpear | E | May 26, 2024, 11:30 a.m. | OK | PyPy 3 | TESTS | 13 | 202 | 5427200 | 1600 | |
262957814 | nealzane | E | May 28, 2024, 4:53 a.m. | OK | PyPy 3 | TESTS | 13 | 312 | 9830400 | 1600 | |
262338430 | Taymyr | E | May 24, 2024, 5:43 a.m. | OK | PyPy 3-64 | TESTS | 13 | 108 | 8806400 | 1600 | |
263182162 | robai2002 | E | May 29, 2024, 8:21 p.m. | OK | PyPy 3-64 | TESTS | 13 | 109 | 8192000 | 1600 | |
262344831 | Super_Misha | E | May 24, 2024, 6:49 a.m. | OK | PyPy 3-64 | TESTS | 13 | 109 | 8192000 | 1600 | |
263089398 | Sariel_snow | E | May 29, 2024, 5:23 a.m. | OK | PyPy 3-64 | TESTS | 13 | 109 | 8601600 | 1600 | |
261176811 | Anav_Agrawal | E | May 16, 2024, 10:08 a.m. | OK | PyPy 3-64 | TESTS | 13 | 109 | 8806400 | 1600 | |
261775430 | pratyanch_jain | E | May 20, 2024, 12:08 p.m. | OK | PyPy 3-64 | TESTS | 13 | 124 | 7475200 | 1600 | |
261781044 | gebeng | E | May 20, 2024, 12:49 p.m. | OK | PyPy 3-64 | TESTS | 13 | 124 | 8089600 | 1600 | |
261087276 | pranjay_sidhwani | E | May 15, 2024, 5:26 p.m. | OK | PyPy 3-64 | TESTS | 13 | 124 | 8089600 | 1600 | |
263703007 | 54skyxenon | E | June 2, 2024, 5:33 a.m. | OK | PyPy 3-64 | TESTS | 13 | 124 | 8601600 | 1600 | |
261997730 | praneethnellutla | E | May 21, 2024, 10:24 a.m. | OK | PyPy 3-64 | TESTS | 13 | 124 | 8601600 | 1600 | |
261212413 | AaryaD2005 | E | May 16, 2024, 2:38 p.m. | OK | Python 3 | TESTS | 13 | 77 | 0 | 1600 | |
261688466 | Chmel_Tolstiy | E | May 19, 2024, 5:58 p.m. | OK | Python 3 | TESTS | 13 | 124 | 0 | 1600 | |
263224069 | cfl5079 | E | May 30, 2024, 10:44 a.m. | OK | Python 3 | TESTS | 13 | 140 | 0 | 1600 | |
261335706 | Mona_4715 | E | May 17, 2024, 1:25 p.m. | OK | Python 3 | TESTS | 13 | 140 | 0 | 1600 | |
262185187 | samoylovboris | E | May 22, 2024, 6:50 p.m. | OK | Python 3 | TESTS | 13 | 155 | 0 | 1600 | |
261117354 | Preetish06 | E | May 16, 2024, 2:26 a.m. | OK | Python 3 | TESTS | 13 | 155 | 0 | 1600 | |
262374621 | __Dk007_____ | E | May 24, 2024, 11:10 a.m. | OK | Python 3 | TESTS | 13 | 156 | 0 | 1600 | |
262973511 | mukund_s | E | May 28, 2024, 7:21 a.m. | OK | Python 3 | TESTS | 13 | 171 | 0 | 1600 | |
263017402 | mihir111p | E | May 28, 2024, 1:26 p.m. | OK | Python 3 | TESTS | 13 | 171 | 204800 | 1600 | |
261477360 | ___a_s_1_2___ | E | May 18, 2024, 7:11 a.m. | OK | Python 3 | TESTS | 13 | 187 | 0 | 1600 | |
263031095 | DarkSky_0xFF | E | May 28, 2024, 3:16 p.m. | OK | Rust 2021 | TESTS | 13 | 46 | 0 | 1600 |
Back to search problems