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 |
---|---|---|---|---|---|---|
1859 | Codeforces Round 892 (Div. 2) | FINISHED | False | 7200 | 39972299 | Aug. 12, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 17126 ) | C | Another Permutation Problem | PROGRAMMING | brute force dp greedy math |
B"Andrey is just starting to come up with problems, and it's difficult for him. That's why he came up with a strange problem about permutations ^{ dagger} and asks you to solve it. Can you do it? Let's call the cost of a permutation p of length n the value of the expression: Find the maximum cost among all permutations of length n . ^{ dagger} A permutation of length n is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation ( 2 appears twice in the array), and [1,3,4] is also not a permutation ( n=3 but there is 4 in the array). Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 30 ) -- the number of test cases. The description of the test cases follows. The only line of each test case contains a single integer n ( 2 <= n <= 250 ) -- the length of the permutation. It is guaranteed that the sum of n over all test cases does not exceed 500 . For each test case, output a single integer -- the maximum cost among all permutations of length n . In the first test case, the permutation with the maximum cost is [2, 1] . The cost is equal to 2 cdot 1 + 1 cdot 2 - max (2 cdot 1, 1 cdot 2)= 2 + 2 - 2 = 2 . In the second test case, the permutation with the maximum cost is [1, 2, 4, 3] . The cost is equal to 1 cdot 1 + 2 cdot 2 + 4 cdot 3 + 3 cdot 4 - 4 cdot 3 = 17 . "... |
Video solutions from Geothermal. |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
218573904 | snapiproof | C | Aug. 12, 2023, 4:28 p.m. | OK | C# 8 | TESTS | 14 | 124 | 102400 | ||
218573768 | kuuso | C | Aug. 12, 2023, 4:27 p.m. | OK | C# 8 | TESTS | 14 | 187 | 3276800 | ||
218594880 | rmsa_07 | C | Aug. 12, 2023, 7:03 p.m. | OK | Clang++17 Diagnostics | TESTS | 14 | 31 | 0 | ||
218604007 | Suryanshsk_ofcl | C | Aug. 12, 2023, 9:07 p.m. | OK | Clang++20 Diagnostics | TESTS | 14 | 93 | 8396800 | ||
218581536 | iffatul_anon | C | Aug. 12, 2023, 5:15 p.m. | OK | GNU C11 | TESTS | 14 | 15 | 0 | ||
218572269 | 1435730 | C | Aug. 12, 2023, 4:24 p.m. | OK | GNU C11 | TESTS | 14 | 15 | 0 | ||
218576097 | anonymuspj | C | Aug. 12, 2023, 4:32 p.m. | OK | GNU C11 | TESTS | 14 | 15 | 0 | ||
218606464 | MandaCR7 | C | Aug. 12, 2023, 9:56 p.m. | OK | GNU C11 | TESTS | 14 | 15 | 0 | ||
218614128 | norising | C | Aug. 13, 2023, 1:35 a.m. | OK | GNU C++14 | TESTS | 14 | 0 | 0 | ||
218627912 | computer_jock | C | Aug. 13, 2023, 5:33 a.m. | OK | GNU C++14 | TESTS | 15 | 0 | 0 | ||
218625875 | SambhavJain | C | Aug. 13, 2023, 5:06 a.m. | OK | GNU C++14 | TESTS | 15 | 0 | 0 | ||
218624884 | xzwys | C | Aug. 13, 2023, 4:51 a.m. | OK | GNU C++14 | TESTS | 15 | 0 | 0 | ||
218624620 | pptwo7 | C | Aug. 13, 2023, 4:47 a.m. | OK | GNU C++14 | TESTS | 15 | 0 | 0 | ||
218623499 | L_C_T | C | Aug. 13, 2023, 4:30 a.m. | OK | GNU C++14 | TESTS | 15 | 0 | 0 | ||
218619951 | hzy99999 | C | Aug. 13, 2023, 3:31 a.m. | OK | GNU C++14 | TESTS | 15 | 0 | 0 | ||
218617114 | khanhdungtrinh | C | Aug. 13, 2023, 2:36 a.m. | OK | GNU C++14 | TESTS | 15 | 0 | 0 | ||
218616853 | KN200711 | C | Aug. 13, 2023, 2:30 a.m. | OK | GNU C++14 | TESTS | 15 | 0 | 0 | ||
218630102 | 202205566318 | C | Aug. 13, 2023, 6:01 a.m. | OK | GNU C++14 | TESTS | 15 | 0 | 0 | ||
218628562 | savaliyadishant3 | C | Aug. 13, 2023, 5:42 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
218627234 | yuval_b | C | Aug. 13, 2023, 5:24 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
218626828 | The_Mad2 | C | Aug. 13, 2023, 5:19 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
218626186 | chaiyihan | C | Aug. 13, 2023, 5:10 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
218624340 | MengXn | C | Aug. 13, 2023, 4:43 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
218624249 | sofer | C | Aug. 13, 2023, 4:42 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
218628801 | abhi7102003 | C | Aug. 13, 2023, 5:45 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
218629217 | CrystronRion | C | Aug. 13, 2023, 5:51 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
218629293 | segfault | C | Aug. 13, 2023, 5:52 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
218628620 | pluie | C | Aug. 13, 2023, 5:43 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
218614141 | Dr.killer | C | Aug. 13, 2023, 1:35 a.m. | OK | GNU C++17 (64) | TESTS | 14 | 0 | 0 | ||
218628126 | rj_king | C | Aug. 13, 2023, 5:36 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 0 | 0 | ||
218626589 | nitin_bisht291 | C | Aug. 13, 2023, 5:16 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 0 | 0 | ||
218624634 | slayycasm997 | C | Aug. 13, 2023, 4:47 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 0 | 0 | ||
218622955 | shubhamsahu1101 | C | Aug. 13, 2023, 4:22 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 0 | 0 | ||
218615990 | Mahfuj_SUST | C | Aug. 13, 2023, 2:13 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 0 | 0 | ||
218610197 | Abdalaziz_Alshami | C | Aug. 12, 2023, 11:37 p.m. | OK | GNU C++17 (64) | TESTS | 14 | 0 | 0 | ||
218605189 | Devansh33 | C | Aug. 12, 2023, 9:28 p.m. | OK | GNU C++17 (64) | TESTS | 14 | 0 | 0 | ||
218604829 | tanmoysarkar46552 | C | Aug. 12, 2023, 9:21 p.m. | OK | GNU C++17 (64) | TESTS | 14 | 0 | 0 | ||
218604692 | enslaved | C | Aug. 12, 2023, 9:19 p.m. | OK | GNU C++17 (64) | TESTS | 14 | 0 | 0 | ||
218627219 | battlefly | C | Aug. 13, 2023, 5:24 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
218627147 | Ultimus007 | C | Aug. 13, 2023, 5:23 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
218626183 | harshitchauhan3 | C | Aug. 13, 2023, 5:10 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
218625969 | I__am___iron____man_3000 | C | Aug. 13, 2023, 5:07 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
218625925 | Rezwan.Arefin01 | C | Aug. 13, 2023, 5:07 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
218625802 | shuai_ | C | Aug. 13, 2023, 5:05 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
218627254 | Thanh_Do | C | Aug. 13, 2023, 5:24 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
218627992 | hoangnguyenh | C | Aug. 13, 2023, 5:34 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
218628654 | Akimizussq | C | Aug. 13, 2023, 5:43 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
218628776 | MeEzOo_ | C | Aug. 13, 2023, 5:45 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
218624433 | hzEnv | C | Aug. 13, 2023, 4:45 a.m. | OK | Go | TESTS | 15 | 15 | 102400 | ||
218593727 | GodFather_ | C | Aug. 12, 2023, 6:49 p.m. | OK | Java 11 | TESTS | 14 | 156 | 0 | ||
218584619 | dwoolley3 | C | Aug. 12, 2023, 5:32 p.m. | OK | Java 11 | TESTS | 14 | 170 | 0 | ||
218626155 | TJ_Codes | C | Aug. 13, 2023, 5:10 a.m. | OK | Java 11 | TESTS | 15 | 171 | 0 | ||
218618257 | chunqiu.ssh | C | Aug. 13, 2023, 2:59 a.m. | OK | Java 11 | TESTS | 15 | 171 | 0 | ||
218593536 | dzhi | C | Aug. 12, 2023, 6:46 p.m. | OK | Java 11 | TESTS | 14 | 171 | 0 | ||
218614864 | habib_48 | C | Aug. 13, 2023, 1:51 a.m. | OK | Java 11 | TESTS | 14 | 186 | 0 | ||
218606789 | Harwinvanak | C | Aug. 12, 2023, 10:02 p.m. | OK | Java 11 | TESTS | 14 | 186 | 0 | ||
218589856 | dineshsharmanit7 | C | Aug. 12, 2023, 6:12 p.m. | OK | Java 11 | TESTS | 14 | 186 | 0 | ||
218607280 | Harwinvanak | C | Aug. 12, 2023, 10:12 p.m. | OK | Java 11 | TESTS | 14 | 187 | 0 | ||
218599325 | kasiru_69 | C | Aug. 12, 2023, 7:56 p.m. | OK | Java 11 | TESTS | 14 | 187 | 0 | ||
218581387 | Pratham2908 | C | Aug. 12, 2023, 5:14 p.m. | OK | Java 17 | TESTS | 14 | 171 | 204800 | ||
218585996 | vaibhav_1710 | C | Aug. 12, 2023, 5:41 p.m. | OK | Java 17 | TESTS | 14 | 171 | 614400 | ||
218608963 | Zakaria_Eysa | C | Aug. 12, 2023, 10:58 p.m. | OK | Java 17 | TESTS | 14 | 186 | 204800 | ||
218611530 | fightingxjz | C | Aug. 13, 2023, 12:23 a.m. | OK | Java 17 | TESTS | 14 | 186 | 512000 | ||
218590353 | Akash_Sardar | C | Aug. 12, 2023, 6:16 p.m. | OK | Java 17 | TESTS | 14 | 187 | 204800 | ||
218597349 | maurya.rahul682 | C | Aug. 12, 2023, 7:31 p.m. | OK | Java 17 | TESTS | 14 | 187 | 614400 | ||
218582546 | daksh_02 | C | Aug. 12, 2023, 5:20 p.m. | OK | Java 17 | TESTS | 14 | 187 | 614400 | ||
218582399 | dakshkhullar14 | C | Aug. 12, 2023, 5:19 p.m. | OK | Java 17 | TESTS | 14 | 187 | 614400 | ||
218579987 | raito3z | C | Aug. 12, 2023, 5:09 p.m. | OK | Java 17 | TESTS | 14 | 202 | 204800 | ||
218577645 | rbaliwal00 | C | Aug. 12, 2023, 4:34 p.m. | OK | Java 17 | TESTS | 14 | 202 | 409600 | ||
218604400 | ManikantanV | C | Aug. 12, 2023, 9:14 p.m. | OK | Java 8 | TESTS | 14 | 93 | 0 | ||
218590389 | dhruvil8804 | C | Aug. 12, 2023, 6:17 p.m. | OK | Java 8 | TESTS | 14 | 93 | 0 | ||
218581347 | This_is_Rish | C | Aug. 12, 2023, 5:14 p.m. | OK | Java 8 | TESTS | 14 | 93 | 0 | ||
218573060 | Coder_unstoppable | C | Aug. 12, 2023, 4:26 p.m. | OK | Java 8 | TESTS | 14 | 93 | 0 | ||
218620202 | priyaroy3370 | C | Aug. 13, 2023, 3:36 a.m. | OK | Java 8 | TESTS | 15 | 108 | 0 | ||
218614343 | seyjs | C | Aug. 13, 2023, 1:39 a.m. | OK | Java 8 | TESTS | 14 | 108 | 0 | ||
218572162 | arutsudar | C | Aug. 12, 2023, 4:24 p.m. | OK | Java 8 | TESTS | 14 | 109 | 0 | ||
218593703 | Yousef_Badr | C | Aug. 12, 2023, 6:48 p.m. | OK | Java 8 | TESTS | 14 | 124 | 0 | ||
218589552 | rishabverma23 | C | Aug. 12, 2023, 6:09 p.m. | OK | Java 8 | TESTS | 14 | 124 | 0 | ||
218580985 | ScoobyDoobyDo | C | Aug. 12, 2023, 5:13 p.m. | OK | Java 8 | TESTS | 14 | 124 | 0 | ||
218607582 | Bobko | C | Aug. 12, 2023, 10:19 p.m. | OK | Kotlin 1.7 | TESTS | 14 | 217 | 0 | ||
218606468 | Bobko | C | Aug. 12, 2023, 9:56 p.m. | OK | Kotlin 1.7 | TESTS | 14 | 218 | 0 | ||
218598869 | IITeens | C | Aug. 12, 2023, 7:50 p.m. | OK | MS C++ 2017 | TESTS | 14 | 15 | 0 | ||
218598075 | IITeens | C | Aug. 12, 2023, 7:40 p.m. | OK | MS C++ 2017 | TESTS | 14 | 15 | 0 | ||
218575776 | Strelok77 | C | Aug. 12, 2023, 4:31 p.m. | OK | MS C++ 2017 | TESTS | 14 | 15 | 0 | ||
218571959 | Gaurav1 | C | Aug. 12, 2023, 4:23 p.m. | OK | PyPy 2 | TESTS | 14 | 155 | 2457600 | ||
218597575 | ex_nihilo | C | Aug. 12, 2023, 7:34 p.m. | OK | PyPy 3 | TESTS | 14 | 77 | 0 | ||
218575416 | grente | C | Aug. 12, 2023, 4:31 p.m. | OK | PyPy 3 | TESTS | 14 | 77 | 1228800 | ||
218629168 | torqueaj | C | Aug. 13, 2023, 5:51 a.m. | OK | PyPy 3 | TESTS | 15 | 93 | 2150400 | ||
218603308 | miho4 | C | Aug. 12, 2023, 8:55 p.m. | OK | PyPy 3 | TESTS | 14 | 93 | 2252800 | ||
218614709 | Keval_78 | C | Aug. 13, 2023, 1:48 a.m. | OK | PyPy 3 | TESTS | 14 | 93 | 67174400 | ||
218623240 | Wooly18 | C | Aug. 13, 2023, 4:27 a.m. | OK | PyPy 3 | TESTS | 15 | 108 | 2150400 | ||
218575727 | 2110030264mehak | C | Aug. 12, 2023, 4:31 p.m. | OK | PyPy 3 | TESTS | 14 | 109 | 2355200 | ||
218594024 | KAMITO | C | Aug. 12, 2023, 6:52 p.m. | OK | PyPy 3 | TESTS | 14 | 2261 | 9318400 | ||
218589974 | RahulSinghIITD | C | Aug. 12, 2023, 6:13 p.m. | OK | PyPy 3-64 | TESTS | 14 | 46 | 1740800 | ||
218585316 | DeepJ | C | Aug. 12, 2023, 5:37 p.m. | OK | PyPy 3-64 | TESTS | 14 | 61 | 0 | ||
218576300 | himanshuyadavhere | C | Aug. 12, 2023, 4:32 p.m. | OK | PyPy 3-64 | TESTS | 14 | 62 | 0 | ||
218576207 | ByteSlinger | C | Aug. 12, 2023, 4:32 p.m. | OK | PyPy 3-64 | TESTS | 14 | 62 | 0 | ||
218572600 | lionkingchuchu | C | Aug. 12, 2023, 4:25 p.m. | OK | PyPy 3-64 | TESTS | 14 | 62 | 0 | ||
218580184 | sr_hossain | C | Aug. 12, 2023, 5:09 p.m. | OK | PyPy 3-64 | TESTS | 14 | 62 | 1536000 | ||
218602587 | pop_mart | C | Aug. 12, 2023, 8:44 p.m. | OK | PyPy 3-64 | TESTS | 14 | 62 | 1638400 | ||
218581641 | CristhianCH | C | Aug. 12, 2023, 5:16 p.m. | OK | PyPy 3-64 | TESTS | 14 | 62 | 1843200 | ||
218615029 | aryanjr2002203 | C | Aug. 13, 2023, 1:55 a.m. | OK | PyPy 3-64 | TESTS | 14 | 62 | 1945600 | ||
218605688 | RBurgundy | C | Aug. 12, 2023, 9:38 p.m. | OK | PyPy 3-64 | TESTS | 14 | 62 | 2048000 | ||
218572428 | 2110030332 | C | Aug. 12, 2023, 4:24 p.m. | OK | Python 2 | TESTS | 14 | 77 | 102400 | ||
218576914 | 2110030327 | C | Aug. 12, 2023, 4:33 p.m. | OK | Python 2 | TESTS | 14 | 93 | 102400 | ||
218582888 | 841_Abhinav | C | Aug. 12, 2023, 5:22 p.m. | OK | Python 3 | TESTS | 14 | 31 | 0 | ||
218627020 | yeshwanth_216 | C | Aug. 13, 2023, 5:21 a.m. | OK | Python 3 | TESTS | 15 | 46 | 0 | ||
218615225 | humblebose | C | Aug. 13, 2023, 1:59 a.m. | OK | Python 3 | TESTS | 14 | 46 | 0 | ||
218609588 | wake__up | C | Aug. 12, 2023, 11:16 p.m. | OK | Python 3 | TESTS | 14 | 46 | 0 | ||
218600935 | yonesMohammad | C | Aug. 12, 2023, 8:19 p.m. | OK | Python 3 | TESTS | 14 | 46 | 0 | ||
218577564 | Emillio | C | Aug. 12, 2023, 4:34 p.m. | OK | Python 3 | TESTS | 14 | 46 | 0 | ||
218577118 | Alderon | C | Aug. 12, 2023, 4:34 p.m. | OK | Python 3 | TESTS | 14 | 46 | 0 | ||
218576224 | templuckycoder555 | C | Aug. 12, 2023, 4:32 p.m. | OK | Python 3 | TESTS | 14 | 46 | 0 | ||
218575683 | bony_always | C | Aug. 12, 2023, 4:31 p.m. | OK | Python 3 | TESTS | 14 | 46 | 102400 | ||
218626767 | hitesh03 | C | Aug. 13, 2023, 5:18 a.m. | OK | Python 3 | TESTS | 15 | 46 | 204800 | ||
218575921 | Forbbi | C | Aug. 12, 2023, 4:32 p.m. | OK | Ruby 3 | TESTS | 14 | 233 | 204800 | ||
218572281 | PeterlitsZo | C | Aug. 12, 2023, 4:24 p.m. | OK | Rust 2021 | TESTS | 14 | 0 | 0 | ||
218612175 | haihamabossu | C | Aug. 13, 2023, 12:44 a.m. | OK | Rust 2021 | TESTS | 14 | 15 | 0 | ||
218574752 | AkagiYuu | C | Aug. 12, 2023, 4:29 p.m. | OK | Rust 2021 | TESTS | 14 | 15 | 0 |
Back to search problems