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 |
---|---|---|---|---|---|---|
1713 | Codeforces Round 812 (Div. 2) | FINISHED | False | 7200 | 72026699 | Aug. 6, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 17472 ) | C | Build Permutation | PROGRAMMING | constructive algorithms dp math | 1200 |
B'A mathbf{0} -indexed array a of size n is called good if for all valid indices i ( 0 <= i <= n-1 ), a_i + i is a perfect square ^ dagger . Given an integer n . Find a permutation ^ ddagger p of [0,1,2, ldots,n-1] that is good or determine that no such permutation exists. ^ dagger An integer x is said to be a perfect square if there exists an integer y such that x = y^2 . ^ ddagger An array b is a permutation of an array a if b consists of the elements of a in arbitrary order. For example, [4,2,3,4] is a permutation of [3,2,4,4] while [1,2,2] is not a permutation of [1,2,3] . The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The only line of each test case contains a single integer n ( 1 <= n <= 10^5 ) -- the length of the permutation p . It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, output n distinct integers p_0, p_1, ... , p_{n-1} ( 0 <= p_i <= n-1 ) -- the permutation p -- if the answer exists, and -1 otherwise. In the first test case, we have n=3 . The array p = [1, 0, 2] is good since 1 + 0 = 1^2 , 0 + 1 = 1^2 , and 2 + 2 = 2^2 In the second test case, we have n=4 . The array p = [0, 3, 2, 1] is good since 0 + 0 = 0^2 , 3 + 1 = 2^2 , 2+2 = 2^2 , and 1+3 = 2^2 . '... |
Codeforces Round #812 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
167343424 | YiLinG | C | Aug. 7, 2022, 3:09 a.m. | OK | GNU C11 | TESTS | 16 | 405 | 819200 | 1200 | |
167344818 | YiLinG | C | Aug. 7, 2022, 3:32 a.m. | OK | GNU C11 | TESTS | 16 | 405 | 819200 | 1200 | |
167300719 | dhruval1234 | C | Aug. 6, 2022, 4:28 p.m. | OK | GNU C11 | TESTS | 16 | 545 | 409600 | 1200 | |
167350684 | ketan120901 | C | Aug. 7, 2022, 5:09 a.m. | OK | GNU C++14 | TESTS | 16 | 15 | 614400 | 1200 | |
167333449 | Mysterious_Cat | C | Aug. 6, 2022, 11:22 p.m. | OK | GNU C++14 | TESTS | 16 | 30 | 0 | 1200 | |
167331364 | ggbrajeshrajpoot | C | Aug. 6, 2022, 10:23 p.m. | OK | GNU C++14 | TESTS | 16 | 30 | 409600 | 1200 | |
167324533 | assiduous27 | C | Aug. 6, 2022, 8:19 p.m. | OK | GNU C++14 | TESTS | 16 | 30 | 409600 | 1200 | |
167312213 | Vibhum | C | Aug. 6, 2022, 6:19 p.m. | OK | GNU C++14 | TESTS | 16 | 30 | 409600 | 1200 | |
167303136 | BlueSharK | C | Aug. 6, 2022, 4:32 p.m. | OK | GNU C++14 | TESTS | 16 | 30 | 409600 | 1200 | |
167317913 | revpro | C | Aug. 6, 2022, 7:03 p.m. | OK | GNU C++14 | TESTS | 16 | 30 | 819200 | 1200 | |
167318149 | Wangxueyi | C | Aug. 6, 2022, 7:06 p.m. | OK | GNU C++14 | TESTS | 16 | 30 | 1228800 | 1200 | |
167350153 | Jenish_ | C | Aug. 7, 2022, 5:01 a.m. | OK | GNU C++14 | TESTS | 16 | 30 | 1228800 | 1200 | |
167302187 | crazy_ox | C | Aug. 6, 2022, 4:30 p.m. | OK | GNU C++14 | TESTS | 16 | 30 | 1740800 | 1200 | |
167313324 | aks_22 | C | Aug. 6, 2022, 6:25 p.m. | OK | GNU C++17 | TESTS | 16 | 15 | 0 | 1200 | |
167313813 | SENPAI_loves_OPPAI | C | Aug. 6, 2022, 6:28 p.m. | OK | GNU C++17 | TESTS | 16 | 15 | 409600 | 1200 | |
167302289 | ggboyy | C | Aug. 6, 2022, 4:30 p.m. | OK | GNU C++17 | TESTS | 16 | 15 | 2457600 | 1200 | |
167312106 | cloudycopter | C | Aug. 6, 2022, 6:19 p.m. | OK | GNU C++17 | TESTS | 16 | 30 | 102400 | 1200 | |
167311834 | Maro_Gamal | C | Aug. 6, 2022, 6:18 p.m. | OK | GNU C++17 | TESTS | 16 | 30 | 409600 | 1200 | |
167311511 | ankur_mittal | C | Aug. 6, 2022, 6:17 p.m. | OK | GNU C++17 | TESTS | 16 | 30 | 409600 | 1200 | |
167302685 | tomfinet | C | Aug. 6, 2022, 4:31 p.m. | OK | GNU C++17 | TESTS | 16 | 30 | 409600 | 1200 | |
167312335 | pro.noob007 | C | Aug. 6, 2022, 6:20 p.m. | OK | GNU C++17 | TESTS | 16 | 30 | 409600 | 1200 | |
167334720 | LCPlayer | C | Aug. 6, 2022, 11:59 p.m. | OK | GNU C++17 | TESTS | 16 | 30 | 409600 | 1200 | |
167345115 | sgsg | C | Aug. 7, 2022, 3:36 a.m. | OK | GNU C++17 | TESTS | 16 | 30 | 409600 | 1200 | |
167329454 | enslaved | C | Aug. 6, 2022, 9:40 p.m. | OK | GNU C++17 (64) | TESTS | 16 | 15 | 409600 | 1200 | |
167324785 | JohanWOW | C | Aug. 6, 2022, 8:22 p.m. | OK | GNU C++17 (64) | TESTS | 16 | 15 | 409600 | 1200 | |
167312585 | BucketPotato | C | Aug. 6, 2022, 6:21 p.m. | OK | GNU C++17 (64) | TESTS | 16 | 15 | 1433600 | 1200 | |
167349371 | saitejapendram | C | Aug. 7, 2022, 4:50 a.m. | OK | GNU C++17 (64) | TESTS | 16 | 15 | 2457600 | 1200 | |
167313024 | Richw818 | C | Aug. 6, 2022, 6:23 p.m. | OK | GNU C++17 (64) | TESTS | 16 | 30 | 409600 | 1200 | |
167330894 | Coder_A007 | C | Aug. 6, 2022, 10:12 p.m. | OK | GNU C++17 (64) | TESTS | 16 | 30 | 409600 | 1200 | |
167319968 | maxwellzen | C | Aug. 6, 2022, 7:24 p.m. | OK | GNU C++17 (64) | TESTS | 16 | 30 | 409600 | 1200 | |
167338151 | Eter.nal | C | Aug. 7, 2022, 1:28 a.m. | OK | GNU C++17 (64) | TESTS | 16 | 30 | 819200 | 1200 | |
167344149 | leo22 | C | Aug. 7, 2022, 3:21 a.m. | OK | GNU C++17 (64) | TESTS | 16 | 30 | 819200 | 1200 | |
167329151 | noob_26 | C | Aug. 6, 2022, 9:34 p.m. | OK | GNU C++17 (64) | TESTS | 16 | 30 | 819200 | 1200 | |
167300528 | kostanya | C | Aug. 6, 2022, 4:27 p.m. | OK | GNU C++20 (64) | TESTS | 16 | 15 | 0 | 1200 | |
167299006 | pinkhippo | C | Aug. 6, 2022, 4:24 p.m. | OK | GNU C++20 (64) | TESTS | 16 | 15 | 0 | 1200 | |
167312036 | patraranya4 | C | Aug. 6, 2022, 6:18 p.m. | OK | GNU C++20 (64) | TESTS | 16 | 15 | 0 | 1200 | |
167325627 | arjun__sharma | C | Aug. 6, 2022, 8:35 p.m. | OK | GNU C++20 (64) | TESTS | 16 | 15 | 0 | 1200 | |
167337232 | Hanonymous | C | Aug. 7, 2022, 1:07 a.m. | OK | GNU C++20 (64) | TESTS | 16 | 15 | 0 | 1200 | |
167331217 | aliyayasser | C | Aug. 6, 2022, 10:20 p.m. | OK | GNU C++20 (64) | TESTS | 16 | 15 | 409600 | 1200 | |
167349055 | aspireboy | C | Aug. 7, 2022, 4:45 a.m. | OK | GNU C++20 (64) | TESTS | 16 | 15 | 409600 | 1200 | |
167339856 | luyue0708 | C | Aug. 7, 2022, 2:07 a.m. | OK | GNU C++20 (64) | TESTS | 16 | 15 | 409600 | 1200 | |
167336099 | _Pioneer | C | Aug. 7, 2022, 12:37 a.m. | OK | GNU C++20 (64) | TESTS | 16 | 15 | 409600 | 1200 | |
167329072 | Aditya_Goyal_ | C | Aug. 6, 2022, 9:32 p.m. | OK | GNU C++20 (64) | TESTS | 16 | 15 | 409600 | 1200 | |
167349933 | justOneStep | C | Aug. 7, 2022, 4:58 a.m. | OK | Go | TESTS | 16 | 46 | 3584000 | 1200 | |
167332639 | kyaruru | C | Aug. 6, 2022, 10:59 p.m. | OK | Java 11 | TESTS | 16 | 186 | 0 | 1200 | |
167333987 | satyaa_78 | C | Aug. 6, 2022, 11:37 p.m. | OK | Java 11 | TESTS | 16 | 187 | 0 | 1200 | |
167334350 | satyaa_78 | C | Aug. 6, 2022, 11:48 p.m. | OK | Java 11 | TESTS | 16 | 202 | 0 | 1200 | |
167323322 | veerabhadra | C | Aug. 6, 2022, 8:04 p.m. | OK | Java 11 | TESTS | 16 | 202 | 0 | 1200 | |
167318796 | mk_0380 | C | Aug. 6, 2022, 7:12 p.m. | OK | Java 11 | TESTS | 16 | 202 | 0 | 1200 | |
167311538 | x21svage | C | Aug. 6, 2022, 6:17 p.m. | OK | Java 11 | TESTS | 16 | 218 | 0 | 1200 | |
167317440 | prac_123 | C | Aug. 6, 2022, 6:59 p.m. | OK | Java 11 | TESTS | 16 | 233 | 0 | 1200 | |
167328082 | IanISam | C | Aug. 6, 2022, 9:14 p.m. | OK | Java 11 | TESTS | 16 | 233 | 3891200 | 1200 | |
167346052 | akumar1503 | C | Aug. 7, 2022, 3:53 a.m. | OK | Java 11 | TESTS | 16 | 249 | 0 | 1200 | |
167315629 | randomrandom1810 | C | Aug. 6, 2022, 6:42 p.m. | OK | Java 11 | TESTS | 16 | 264 | 0 | 1200 | |
167312646 | shubham_409 | C | Aug. 6, 2022, 6:21 p.m. | OK | Java 17 | TESTS | 16 | 233 | 307200 | 1200 | |
167311644 | syntaxsugar | C | Aug. 6, 2022, 6:17 p.m. | OK | Java 17 | TESTS | 16 | 249 | 819200 | 1200 | |
167319179 | princeayush04 | C | Aug. 6, 2022, 7:16 p.m. | OK | Java 17 | TESTS | 16 | 280 | 614400 | 1200 | |
167302053 | nuyh99 | C | Aug. 6, 2022, 4:30 p.m. | OK | Java 17 | TESTS | 16 | 327 | 204800 | 1200 | |
167312919 | Eslam_Ahmed | C | Aug. 6, 2022, 6:23 p.m. | OK | Java 17 | TESTS | 16 | 405 | 307200 | 1200 | |
167320451 | ItsZaki | C | Aug. 6, 2022, 7:30 p.m. | OK | Java 17 | TESTS | 16 | 546 | 5222400 | 1200 | |
167312690 | Eslam_Ahmed | C | Aug. 6, 2022, 6:21 p.m. | OK | Java 17 | TESTS | 16 | 576 | 716800 | 1200 | |
167319963 | ItsZaki | C | Aug. 6, 2022, 7:24 p.m. | OK | Java 17 | TESTS | 16 | 592 | 5222400 | 1200 | |
167314133 | redoc_007 | C | Aug. 6, 2022, 6:30 p.m. | OK | Java 8 | TESTS | 16 | 109 | 0 | 1200 | |
167343371 | rnss | C | Aug. 7, 2022, 3:09 a.m. | OK | Java 8 | TESTS | 16 | 124 | 0 | 1200 | |
167328936 | T_PAVAN_NAGARAJU | C | Aug. 6, 2022, 9:30 p.m. | OK | Java 8 | TESTS | 16 | 139 | 0 | 1200 | |
167354462 | Washoum | C | Aug. 7, 2022, 5:55 a.m. | OK | Java 8 | TESTS | 16 | 140 | 0 | 1200 | |
167322590 | Parimal | C | Aug. 6, 2022, 7:54 p.m. | OK | Java 8 | TESTS | 16 | 140 | 0 | 1200 | |
167353296 | swaggy_baba | C | Aug. 7, 2022, 5:41 a.m. | OK | Java 8 | TESTS | 16 | 140 | 5529600 | 1200 | |
167340762 | radheradhebol | C | Aug. 7, 2022, 2:22 a.m. | OK | Java 8 | TESTS | 16 | 140 | 5529600 | 1200 | |
167320851 | toufique_husein | C | Aug. 6, 2022, 7:34 p.m. | OK | Java 8 | TESTS | 16 | 155 | 4096000 | 1200 | |
167316250 | Erasylll | C | Aug. 6, 2022, 6:47 p.m. | OK | Java 8 | TESTS | 16 | 171 | 0 | 1200 | |
167311620 | priyaroy3370 | C | Aug. 6, 2022, 6:17 p.m. | OK | Java 8 | TESTS | 16 | 186 | 0 | 1200 | |
167302356 | Bloodwyn | C | Aug. 6, 2022, 4:31 p.m. | OK | Kotlin 1.6 | TESTS | 16 | 296 | 5120000 | 1200 | |
167340974 | hiro220214 | C | Aug. 7, 2022, 2:26 a.m. | OK | MS C++ 2017 | TESTS | 16 | 46 | 819200 | 1200 | |
167336172 | hua_yi_jiu | C | Aug. 7, 2022, 12:39 a.m. | OK | MS C++ 2017 | TESTS | 16 | 46 | 3993600 | 1200 | |
167345668 | thoanhkhoa2702 | C | Aug. 7, 2022, 3:46 a.m. | OK | MS C++ 2017 | TESTS | 16 | 62 | 409600 | 1200 | |
167348426 | coicy | C | Aug. 7, 2022, 4:35 a.m. | OK | MS C++ 2017 | TESTS | 16 | 62 | 819200 | 1200 | |
167348625 | Mindaev_Damir | C | Aug. 7, 2022, 4:38 a.m. | OK | MS C++ 2017 | TESTS | 16 | 77 | 1536000 | 1200 | |
167320181 | NooB_VansH | C | Aug. 6, 2022, 7:27 p.m. | OK | MS C++ 2017 | TESTS | 16 | 78 | 409600 | 1200 | |
167302411 | sohail_377 | C | Aug. 6, 2022, 4:31 p.m. | OK | MS C++ 2017 | TESTS | 16 | 78 | 409600 | 1200 | |
167299054 | khandelwaldhruv002 | C | Aug. 6, 2022, 4:24 p.m. | OK | MS C++ 2017 | TESTS | 16 | 78 | 409600 | 1200 | |
167312434 | Bu1izhnik | C | Aug. 6, 2022, 6:20 p.m. | OK | MS C++ 2017 | TESTS | 16 | 78 | 819200 | 1200 | |
167299911 | moneerzaki | C | Aug. 6, 2022, 4:26 p.m. | OK | MS C++ 2017 | TESTS | 16 | 109 | 819200 | 1200 | |
167324513 | 1_2_3_4_5_9 | C | Aug. 6, 2022, 8:19 p.m. | OK | PyPy 2 | TESTS | 16 | 186 | 10752000 | 1200 | |
167349934 | nicku123 | C | Aug. 7, 2022, 4:58 a.m. | OK | PyPy 3 | TESTS | 16 | 124 | 6860800 | 1200 | |
167324178 | abcsumit | C | Aug. 6, 2022, 8:14 p.m. | OK | PyPy 3 | TESTS | 16 | 171 | 9523200 | 1200 | |
167312702 | Su_123 | C | Aug. 6, 2022, 6:21 p.m. | OK | PyPy 3 | TESTS | 16 | 249 | 8806400 | 1200 | |
167344716 | venkataakhil4518 | C | Aug. 7, 2022, 3:30 a.m. | OK | PyPy 3 | TESTS | 16 | 264 | 11264000 | 1200 | |
167299133 | _RobotYar_ | C | Aug. 6, 2022, 4:24 p.m. | OK | PyPy 3 | TESTS | 16 | 265 | 8089600 | 1200 | |
167311403 | sgcc | C | Aug. 6, 2022, 6:16 p.m. | OK | PyPy 3 | TESTS | 16 | 295 | 9420800 | 1200 | |
167332834 | farrellbyu | C | Aug. 6, 2022, 11:04 p.m. | OK | PyPy 3-64 | TESTS | 16 | 77 | 8908800 | 1200 | |
167339120 | blue_ice_yj | C | Aug. 7, 2022, 1:51 a.m. | OK | PyPy 3-64 | TESTS | 16 | 109 | 10342400 | 1200 | |
167329170 | dunkin_shepherd | C | Aug. 6, 2022, 9:34 p.m. | OK | PyPy 3-64 | TESTS | 16 | 109 | 10547200 | 1200 | |
167345696 | Youarenotgood | C | Aug. 7, 2022, 3:46 a.m. | OK | PyPy 3-64 | TESTS | 16 | 124 | 10035200 | 1200 | |
167326486 | Amay12 | C | Aug. 6, 2022, 8:47 p.m. | OK | PyPy 3-64 | TESTS | 16 | 124 | 12083200 | 1200 | |
167337170 | ASawe2.6Main | C | Aug. 7, 2022, 1:05 a.m. | OK | PyPy 3-64 | TESTS | 16 | 124 | 14028800 | 1200 | |
167320689 | watermelonsha | C | Aug. 6, 2022, 7:32 p.m. | OK | PyPy 3-64 | TESTS | 16 | 139 | 9932800 | 1200 | |
167319601 | SangeetaSingh | C | Aug. 6, 2022, 7:20 p.m. | OK | PyPy 3-64 | TESTS | 16 | 139 | 9932800 | 1200 | |
167324670 | DarkHorse_it_iz2.0 | C | Aug. 6, 2022, 8:21 p.m. | OK | PyPy 3-64 | TESTS | 16 | 140 | 10547200 | 1200 | |
167311450 | shekhawat_rss | C | Aug. 6, 2022, 6:17 p.m. | OK | PyPy 3-64 | TESTS | 16 | 140 | 18124800 | 1200 | |
167336546 | yujt123 | C | Aug. 7, 2022, 12:49 a.m. | OK | Python 3 | TESTS | 16 | 139 | 6144000 | 1200 | |
167325256 | striker7869 | C | Aug. 6, 2022, 8:29 p.m. | OK | Python 3 | TESTS | 16 | 186 | 3072000 | 1200 | |
167318103 | betal | C | Aug. 6, 2022, 7:05 p.m. | OK | Python 3 | TESTS | 16 | 202 | 3072000 | 1200 | |
167334443 | sshinohs | C | Aug. 6, 2022, 11:51 p.m. | OK | Python 3 | TESTS | 16 | 202 | 4198400 | 1200 | |
167353522 | Naman_nirwan113 | C | Aug. 7, 2022, 5:44 a.m. | OK | Python 3 | TESTS | 16 | 202 | 5017600 | 1200 | |
167329134 | HexHowells | C | Aug. 6, 2022, 9:33 p.m. | OK | Python 3 | TESTS | 16 | 217 | 2969600 | 1200 | |
167329190 | dunkin_shepherd | C | Aug. 6, 2022, 9:35 p.m. | OK | Python 3 | TESTS | 16 | 218 | 3072000 | 1200 | |
167342295 | joi_ | C | Aug. 7, 2022, 2:51 a.m. | OK | Python 3 | TESTS | 16 | 265 | 0 | 1200 | |
167304266 | kotprogrammist | C | Aug. 6, 2022, 4:34 p.m. | OK | Python 3 | TESTS | 16 | 296 | 9728000 | 1200 | |
167312428 | AyuAnchor | C | Aug. 6, 2022, 6:20 p.m. | OK | Python 3 | TESTS | 16 | 311 | 3891200 | 1200 | |
167330116 | kena0ki | C | Aug. 6, 2022, 9:54 p.m. | OK | Rust 2021 | TESTS | 16 | 31 | 2252800 | 1200 | |
167318816 | tngyl | C | Aug. 6, 2022, 7:12 p.m. | OK | Rust 2021 | TESTS | 16 | 108 | 0 | 1200 |
Back to search problems