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 |
---|---|---|---|---|---|---|
1676 | Codeforces Round 790 (Div. 4) | FINISHED | False | 7200 | 84986063 | May 10, 2022, 2:45 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 14548 ) | H1 | Maximum Crossings (Easy Version) | PROGRAMMING | brute force |
B"The only difference between the two versions is that in this version n <= q 1000 and the sum of n over all test cases does not exceed 1000 . A terminal is a row of n equal segments numbered 1 to n in order. There are two terminals, one above the other. You are given an array a of length n . For all i = 1, 2, ... , n , there should be a straight wire from some point on segment i of the top terminal to some point on segment a_i of the bottom terminal. You can't select the endpoints of a segment. For example, the following pictures show two possible wirings if n=7 and a=[4,1,4,6,7,7,5] . A crossing occurs when two wires share a point in common. In the picture above, crossings are circled in red. What is the maximum number of crossings there can be if you place the wires optimally? The first line contains an integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. The first line of each test case contains an integer n ( 1 <= q n <= q 1000 ) -- the length of the array. The second line of each test case contains n integers a_1, a_2, ... , a_n ( 1 <= q a_i <= q n ) -- the elements of the array. The sum of n across all test cases does not exceed 1000 . For each test case, output a single integer -- the maximum number of crossings there can be if you place the wires optimally. The first test case is shown in the second picture in the statement. In the second test case, the only wiring possible has the two wires cross, so the answer is 1 . In the third test case, the only wiring possible has one wire, so the answer is 0 . "... |
Codeforces Round #790 (Div. 4) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
156871523 | sasung | H1 | May 11, 2022, 10:14 p.m. | OK | C# 10 | TESTS | 13 | 31 | 307200 | ||
156872151 | bluemegane | H1 | May 11, 2022, 10:39 p.m. | OK | C# 8 | TESTS | 13 | 77 | 409600 | ||
156853303 | Yewandou | H1 | May 11, 2022, 4:54 p.m. | OK | Clang++17 Diagnostics | TESTS | 13 | 31 | 2662400 | ||
156864874 | Denor | H1 | May 11, 2022, 7:39 p.m. | OK | Delphi | TESTS | 13 | 31 | 921600 | ||
156868073 | gargbhawarth | H1 | May 11, 2022, 8:40 p.m. | OK | GNU C++14 | TESTS | 13 | 0 | 0 | ||
156864009 | Shivangini_5519 | H1 | May 11, 2022, 7:23 p.m. | OK | GNU C++14 | TESTS | 13 | 0 | 0 | ||
156814446 | JPMM | H1 | May 11, 2022, 9:38 a.m. | OK | GNU C++14 | TESTS | 13 | 0 | 0 | ||
156791132 | Ulzl00 | H1 | May 11, 2022, 7:24 a.m. | OK | GNU C++14 | TESTS | 13 | 0 | 0 | ||
156841345 | anurps9 | H1 | May 11, 2022, 2:25 p.m. | OK | GNU C++14 | TESTS | 13 | 0 | 204800 | ||
156789077 | luogu_bot2 | H1 | May 11, 2022, 6:58 a.m. | OK | GNU C++14 | TESTS | 13 | 0 | 819200 | ||
156788752 | zltzlt | H1 | May 11, 2022, 6:54 a.m. | OK | GNU C++14 | TESTS | 13 | 0 | 819200 | ||
156859014 | Darsh1031 | H1 | May 11, 2022, 6:09 p.m. | OK | GNU C++14 | TESTS | 13 | 0 | 1024000 | ||
156884707 | princekr1447 | H1 | May 12, 2022, 5 a.m. | OK | GNU C++14 | TESTS | 13 | 15 | 0 | ||
156882532 | farjana_dipa | H1 | May 12, 2022, 4:15 a.m. | OK | GNU C++14 | TESTS | 13 | 15 | 0 | ||
156864773 | ksn_va | H1 | May 11, 2022, 7:37 p.m. | OK | GNU C++17 | TESTS | 13 | 0 | 0 | ||
156834530 | Aryan11 | H1 | May 11, 2022, 1:13 p.m. | OK | GNU C++17 | TESTS | 13 | 0 | 0 | ||
156834174 | pict1115 | H1 | May 11, 2022, 1:10 p.m. | OK | GNU C++17 | TESTS | 13 | 0 | 0 | ||
156827036 | RANGO552 | H1 | May 11, 2022, 11:58 a.m. | OK | GNU C++17 | TESTS | 13 | 0 | 0 | ||
156821263 | Topazz | H1 | May 11, 2022, 10:58 a.m. | OK | GNU C++17 | TESTS | 13 | 0 | 0 | ||
156796844 | whd14333 | H1 | May 11, 2022, 8:33 a.m. | OK | GNU C++17 | TESTS | 13 | 0 | 0 | ||
156887645 | darkandy | H1 | May 12, 2022, 5:54 a.m. | OK | GNU C++17 | TESTS | 13 | 0 | 102400 | ||
156885717 | hashiras | H1 | May 12, 2022, 5:19 a.m. | OK | GNU C++17 | TESTS | 13 | 0 | 102400 | ||
156856126 | WannaSleep43 | H1 | May 11, 2022, 5:33 p.m. | OK | GNU C++17 | TESTS | 13 | 0 | 102400 | ||
156854913 | ekam | H1 | May 11, 2022, 5:16 p.m. | OK | GNU C++17 | TESTS | 13 | 0 | 102400 | ||
156884373 | goddice | H1 | May 12, 2022, 4:54 a.m. | OK | GNU C++17 (64) | TESTS | 13 | 0 | 0 | ||
156870194 | Mahmoud217 | H1 | May 11, 2022, 9:30 p.m. | OK | GNU C++17 (64) | TESTS | 13 | 0 | 0 | ||
156860013 | Indranildgupta | H1 | May 11, 2022, 6:24 p.m. | OK | GNU C++17 (64) | TESTS | 13 | 0 | 0 | ||
156852531 | SakiBee | H1 | May 11, 2022, 4:43 p.m. | OK | GNU C++17 (64) | TESTS | 13 | 0 | 0 | ||
156793692 | _Pioneer | H1 | May 11, 2022, 7:55 a.m. | OK | GNU C++17 (64) | TESTS | 13 | 0 | 0 | ||
156792070 | _YoU_KnOw_DeEpAk | H1 | May 11, 2022, 7:36 a.m. | OK | GNU C++17 (64) | TESTS | 13 | 0 | 0 | ||
156791360 | isheoran | H1 | May 11, 2022, 7:27 a.m. | OK | GNU C++17 (64) | TESTS | 13 | 0 | 0 | ||
156836454 | coder186 | H1 | May 11, 2022, 1:33 p.m. | OK | GNU C++17 (64) | TESTS | 13 | 0 | 1024000 | ||
156792978 | jiajieshi | H1 | May 11, 2022, 7:47 a.m. | OK | GNU C++17 (64) | TESTS | 13 | 0 | 1638400 | ||
156878066 | HanaaAhmed | H1 | May 12, 2022, 2:25 a.m. | OK | GNU C++17 (64) | TESTS | 13 | 15 | 0 | ||
156859503 | coding_priest7 | H1 | May 11, 2022, 6:16 p.m. | OK | GNU C++20 (64) | TESTS | 13 | 0 | 0 | ||
156854310 | SCOR_PION | H1 | May 11, 2022, 5:08 p.m. | OK | GNU C++20 (64) | TESTS | 13 | 0 | 0 | ||
156854092 | SAYANJIT7 | H1 | May 11, 2022, 5:05 p.m. | OK | GNU C++20 (64) | TESTS | 13 | 0 | 0 | ||
156851475 | Santoryu | H1 | May 11, 2022, 4:30 p.m. | OK | GNU C++20 (64) | TESTS | 13 | 0 | 0 | ||
156851186 | Enma | H1 | May 11, 2022, 4:26 p.m. | OK | GNU C++20 (64) | TESTS | 13 | 0 | 0 | ||
156848650 | ati007 | H1 | May 11, 2022, 3:55 p.m. | OK | GNU C++20 (64) | TESTS | 13 | 0 | 0 | ||
156845434 | jsu-2021401502CYH | H1 | May 11, 2022, 3:16 p.m. | OK | GNU C++20 (64) | TESTS | 13 | 0 | 0 | ||
156842640 | yuexia | H1 | May 11, 2022, 2:40 p.m. | OK | GNU C++20 (64) | TESTS | 13 | 0 | 0 | ||
156839307 | iCoderAkash | H1 | May 11, 2022, 2:04 p.m. | OK | GNU C++20 (64) | TESTS | 13 | 0 | 0 | ||
156838104 | 1.618033 | H1 | May 11, 2022, 1:50 p.m. | OK | GNU C++20 (64) | TESTS | 13 | 0 | 0 | ||
156843681 | keutoi | H1 | May 11, 2022, 2:53 p.m. | OK | Haskell | TESTS | 13 | 31 | 0 | ||
156887312 | legit_123 | H1 | May 12, 2022, 5:48 a.m. | OK | Java 11 | TESTS | 13 | 155 | 0 | ||
156865875 | dhruvil_01 | H1 | May 11, 2022, 7:56 p.m. | OK | Java 11 | TESTS | 13 | 171 | 0 | ||
156856873 | rhaena46 | H1 | May 11, 2022, 5:43 p.m. | OK | Java 11 | TESTS | 13 | 186 | 0 | ||
156841060 | flyroko | H1 | May 11, 2022, 2:22 p.m. | OK | Java 11 | TESTS | 13 | 186 | 0 | ||
156834290 | yash13203 | H1 | May 11, 2022, 1:11 p.m. | OK | Java 11 | TESTS | 13 | 202 | 0 | ||
156798366 | Aaryendra | H1 | May 11, 2022, 8:51 a.m. | OK | Java 11 | TESTS | 13 | 218 | 0 | ||
156788514 | konetichandrakant | H1 | May 11, 2022, 6:51 a.m. | OK | Java 11 | TESTS | 13 | 218 | 0 | ||
156798141 | alibaba | H1 | May 11, 2022, 8:48 a.m. | OK | Java 8 | TESTS | 13 | 92 | 0 | ||
156866616 | adi_7861 | H1 | May 11, 2022, 8:10 p.m. | OK | Java 8 | TESTS | 13 | 93 | 0 | ||
156859268 | CecilioG | H1 | May 11, 2022, 6:13 p.m. | OK | Java 8 | TESTS | 13 | 93 | 0 | ||
156835042 | govindrajput | H1 | May 11, 2022, 1:18 p.m. | OK | Java 8 | TESTS | 13 | 93 | 0 | ||
156832887 | Youssef1Shawky | H1 | May 11, 2022, 12:57 p.m. | OK | Java 8 | TESTS | 13 | 93 | 0 | ||
156793021 | ahmedtawfik | H1 | May 11, 2022, 7:47 a.m. | OK | Java 8 | TESTS | 13 | 93 | 0 | ||
156819122 | ttolkku | H1 | May 11, 2022, 10:32 a.m. | OK | Java 8 | TESTS | 13 | 108 | 0 | ||
156792932 | AhmedEl-Gohary | H1 | May 11, 2022, 7:46 a.m. | OK | Java 8 | TESTS | 13 | 108 | 0 | ||
156880143 | ninado_dante | H1 | May 12, 2022, 3:21 a.m. | OK | Java 8 | TESTS | 13 | 108 | 38195200 | ||
156831151 | subhankar.majumdar.752 | H1 | May 11, 2022, 12:40 p.m. | OK | Java 8 | TESTS | 13 | 124 | 0 | ||
156846142 | Mikhail1928 | H1 | May 11, 2022, 3:24 p.m. | OK | MS C++ 2017 | TESTS | 13 | 15 | 0 | ||
156815758 | XYShaoKang | H1 | May 11, 2022, 9:53 a.m. | OK | Node.js | TESTS | 13 | 62 | 2457600 | ||
156870001 | NAVI_Perfecto | H1 | May 11, 2022, 9:24 p.m. | OK | PyPy 3 | TESTS | 13 | 155 | 3481600 | ||
156852304 | snape_here | H1 | May 11, 2022, 4:40 p.m. | OK | PyPy 3 | TESTS | 13 | 218 | 5427200 | ||
156814871 | asdsasd | H1 | May 11, 2022, 9:43 a.m. | OK | PyPy 3-64 | TESTS | 13 | 77 | 2457600 | ||
156787449 | swapnilvc | H1 | May 11, 2022, 6:39 a.m. | OK | PyPy 3-64 | TESTS | 13 | 77 | 2457600 | ||
156816781 | shubh1815 | H1 | May 11, 2022, 10:06 a.m. | OK | PyPy 3-64 | TESTS | 13 | 77 | 2867200 | ||
156838571 | sakurahashu | H1 | May 11, 2022, 1:56 p.m. | OK | PyPy 3-64 | TESTS | 13 | 77 | 3174400 | ||
156788386 | practise_iiitb | H1 | May 11, 2022, 6:49 a.m. | OK | PyPy 3-64 | TESTS | 13 | 77 | 3379200 | ||
156848345 | Maximilian06 | H1 | May 11, 2022, 3:51 p.m. | OK | PyPy 3-64 | TESTS | 13 | 78 | 4608000 | ||
156862112 | abhaumik24 | H1 | May 11, 2022, 6:53 p.m. | OK | PyPy 3-64 | TESTS | 13 | 93 | 19763200 | ||
156854938 | notTehlka | H1 | May 11, 2022, 5:17 p.m. | OK | PyPy 3-64 | TESTS | 13 | 108 | 3072000 | ||
156837195 | ktthree | H1 | May 11, 2022, 1:41 p.m. | OK | PyPy 3-64 | TESTS | 13 | 109 | 4403200 | ||
156829039 | noobsatish | H1 | May 11, 2022, 12:19 p.m. | OK | PyPy 3-64 | TESTS | 13 | 124 | 6963200 | ||
156872411 | kunal_2.0 | H1 | May 11, 2022, 10:48 p.m. | OK | Python 3 | TESTS | 13 | 46 | 0 | ||
156787649 | poornaTheja | H1 | May 11, 2022, 6:41 a.m. | OK | Python 3 | TESTS | 13 | 155 | 0 | ||
156787097 | Block_Cipher | H1 | May 11, 2022, 6:35 a.m. | OK | Python 3 | TESTS | 13 | 186 | 409600 | ||
156798969 | Mur | H1 | May 11, 2022, 8:58 a.m. | OK | Ruby 3 | TESTS | 13 | 249 | 2252800 |
Back to search problems