Codeforces Round 789 (Div. 1)

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
1677 Codeforces Round 789 (Div. 1) FINISHED False 7200 85159463 May 8, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8614 ) A Tokitsukaze and Strange Inequality PROGRAMMING data structures dp

B'Tokitsukaze has a permutation p of length n . Recall that a permutation p of length n is a sequence p_1, p_2, ldots, p_n consisting of n distinct integers, each of which from 1 to n ( 1 <= q p_i <= q n ). She wants to know how many different indices tuples [a,b,c,d] ( 1 <= q a < b < c < d <= q n ) in this permutation satisfy the following two inequalities: Note that two tuples [a_1,b_1,c_1,d_1] and [a_2,b_2,c_2,d_2] are considered to be different if a_1 ne a_2 or b_1 ne b_2 or c_1 ne c_2 or d_1 ne d_2 . The first line contains one integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. Each test case consists of two lines. The first line contains a single integer n ( 4 <= q n <= q 5000 ) -- the length of permutation p . The second line contains n integers p_1, p_2, ldots, p_n ( 1 <= q p_i <= q n ) -- the permutation p . It is guaranteed that the sum of n over all test cases does not exceed 5000 . For each test case, print a single integer -- the number of different [a,b,c,d] tuples. In the first test case, there are 3 different [a,b,c,d] tuples. p_1 = 5 , p_2 = 3 , p_3 = 6 , p_4 = 1 , where p_1 < p_3 and p_2 > p_4 satisfies the inequality, so one of [a,b,c,d] tuples is [1,2,3,4] . Similarly, other two tuples are [1,2,3,6] , [2,3,5,6] . '...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
156304861 Gassa A May 8, 2022, 2:47 p.m. OK D TESTS 68 202 157388800
156310566 chro4896 A May 8, 2022, 2:55 p.m. OK GNU C11 TESTS 68 514 200089600
156299153 jumpmelon A May 8, 2022, 2:41 p.m. OK GNU C++14 TESTS 68 46 0
156316434 Milesian A May 8, 2022, 3:05 p.m. OK GNU C++14 TESTS 68 46 0
156300540 SuperJ6 A May 8, 2022, 2:42 p.m. OK GNU C++14 TESTS 68 46 102400
156370666 chumeng A May 9, 2022, 12:18 a.m. OK GNU C++14 TESTS 68 46 102400
156296838 gisp_zjz A May 8, 2022, 2:39 p.m. OK GNU C++14 TESTS 68 62 0
156300306 Arg_007 A May 8, 2022, 2:42 p.m. OK GNU C++14 TESTS 68 62 0
156300732 Commonrain A May 8, 2022, 2:43 p.m. OK GNU C++14 TESTS 68 62 204800
156363417 Bliss_of_comprehension A May 8, 2022, 8:19 p.m. OK GNU C++14 TESTS 68 62 100454400
156302192 Aleph-zero A May 8, 2022, 2:44 p.m. OK GNU C++14 TESTS 68 93 0
156306467 Max_Calincu A May 8, 2022, 2:49 p.m. OK GNU C++14 TESTS 68 93 102400
156302892 CWB_the_most_powerful A May 8, 2022, 2:45 p.m. OK GNU C++17 TESTS 68 46 0
156307996 BSBandme A May 8, 2022, 2:51 p.m. OK GNU C++17 TESTS 68 46 102400
156384510 hohohahahihi A May 9, 2022, 5:54 a.m. OK GNU C++17 TESTS 68 46 102400
156302782 fallac A May 8, 2022, 2:45 p.m. OK GNU C++17 TESTS 68 46 1228800
156302755 reiofa A May 8, 2022, 2:45 p.m. OK GNU C++17 TESTS 68 61 102400
156306530 Puranya_ A May 8, 2022, 2:49 p.m. OK GNU C++17 TESTS 68 61 102400
156296283 Wailydest A May 8, 2022, 2:38 p.m. OK GNU C++17 TESTS 68 62 0
156297236 Hasan0540 A May 8, 2022, 2:39 p.m. OK GNU C++17 TESTS 68 62 204800
156300305 Rewenix A May 8, 2022, 2:42 p.m. OK GNU C++17 TESTS 68 62 204800
156298315 lucri A May 8, 2022, 2:40 p.m. OK GNU C++17 TESTS 68 77 102400
156295985 kotatsugame A May 8, 2022, 2:37 p.m. OK GNU C++17 (64) TESTS 68 31 0
156315435 xuqijie A May 8, 2022, 3:03 p.m. OK GNU C++17 (64) TESTS 68 31 0
156300168 zlc1114_v2 A May 8, 2022, 2:42 p.m. OK GNU C++17 (64) TESTS 68 31 7987200
156353016 zlc1114 A May 8, 2022, 5:39 p.m. OK GNU C++17 (64) TESTS 68 31 7987200
156306156 syzf2222 A May 8, 2022, 2:49 p.m. OK GNU C++17 (64) TESTS 68 46 102400
156302566 udon1206 A May 8, 2022, 2:45 p.m. OK GNU C++17 (64) TESTS 68 62 102400
156296963 used-fft A May 8, 2022, 2:39 p.m. OK GNU C++17 (64) TESTS 68 62 102400
156351404 Lucina A May 8, 2022, 5:25 p.m. OK GNU C++17 (64) TESTS 68 78 0
156296069 MeliodasIRA A May 8, 2022, 2:37 p.m. OK GNU C++17 (64) TESTS 68 78 0
156355483 iLLusio A May 8, 2022, 6:08 p.m. OK GNU C++17 (64) TESTS 68 78 102400
156300532 al13n A May 8, 2022, 2:42 p.m. OK GNU C++20 (64) TESTS 68 31 102400
156371028 TheLastHope A May 9, 2022, 12:32 a.m. OK GNU C++20 (64) TESTS 68 31 102400
156370133 Dhruv_Singh_Jadon A May 8, 2022, 11:58 p.m. OK GNU C++20 (64) TESTS 68 31 102400
156355828 wxhtzdy A May 8, 2022, 6:12 p.m. OK GNU C++20 (64) TESTS 68 31 102400
156351466 fishcathu. A May 8, 2022, 5:26 p.m. OK GNU C++20 (64) TESTS 68 31 102400
156351043 maxplus A May 8, 2022, 5:23 p.m. OK GNU C++20 (64) TESTS 68 31 102400
156309695 cychien A May 8, 2022, 2:54 p.m. OK GNU C++20 (64) TESTS 68 31 102400
156301539 Suika_predator A May 8, 2022, 2:44 p.m. OK GNU C++20 (64) TESTS 68 31 102400
156300673 _su1sen A May 8, 2022, 2:43 p.m. OK GNU C++20 (64) TESTS 68 31 102400
156298680 PrinceBubblegum A May 8, 2022, 2:41 p.m. OK GNU C++20 (64) TESTS 68 31 102400
156379480 MoonCoder1234 A May 9, 2022, 4:05 a.m. OK Java 11 TESTS 68 265 0
156379160 MoonCoder1234 A May 9, 2022, 3:58 a.m. OK Java 11 TESTS 68 311 0
156354177 x21svage A May 8, 2022, 5:52 p.m. OK Java 11 TESTS 68 670 0
156301565 knightL A May 8, 2022, 2:44 p.m. OK Java 11 TESTS 68 748 145203200
156318183 yehara A May 8, 2022, 3:08 p.m. OK Java 11 TESTS 68 982 0
156314606 DarLam A May 8, 2022, 3:02 p.m. OK Java 8 TESTS 68 202 0
156382268 sharpen A May 9, 2022, 5:10 a.m. OK Java 8 TESTS 68 265 0
156362015 megaspazz A May 8, 2022, 7:50 p.m. OK Java 8 TESTS 68 530 142233600
156312371 AndreySiunov A May 8, 2022, 2:58 p.m. OK Java 8 TESTS 68 576 0
156384074 govindrajput A May 9, 2022, 5:45 a.m. OK Java 8 TESTS 68 686 142438400
156316783 megaspazz A May 8, 2022, 3:06 p.m. OK Java 8 TESTS 68 701 258457600
156305522 SecondThread A May 8, 2022, 2:48 p.m. OK Java 8 TESTS 68 717 148684800
156310266 DumplingLife A May 8, 2022, 2:54 p.m. OK Java 8 TESTS 68 732 258662400
156315034 fetetriste A May 8, 2022, 3:02 p.m. OK Java 8 TESTS 68 873 258662400
156306531 golions A May 8, 2022, 2:49 p.m. OK Java 8 TESTS 68 1450 258560000
156299517 arvindf232 A May 8, 2022, 2:41 p.m. OK Kotlin 1.4 TESTS 68 358 1228800
156311613 Hakiobo A May 8, 2022, 2:57 p.m. OK Kotlin 1.4 TESTS 68 623 255180800
156298536 Tlatoani A May 8, 2022, 2:40 p.m. OK Kotlin 1.4 TESTS 68 857 261222400
156354745 titia A May 8, 2022, 5:58 p.m. OK Kotlin 1.6 TESTS 68 1310 261836800
156323641 r57shell A May 8, 2022, 3:20 p.m. OK MS C++ 2017 TESTS 68 358 200601600
156308147 machine_solution A May 8, 2022, 2:51 p.m. OK MS C++ 2017 TESTS 68 436 105574400
156328443 whatshisbucket A May 8, 2022, 3:33 p.m. OK PyPy 3 TESTS 68 780 59596800
156321572 taiga0629 A May 8, 2022, 3:16 p.m. OK PyPy 3-64 TESTS 68 202 10342400
156353313 notTehlka A May 8, 2022, 5:42 p.m. OK PyPy 3-64 TESTS 68 265 7372800
156307229 notnotTehlka A May 8, 2022, 2:50 p.m. OK PyPy 3-64 TESTS 68 265 7372800
156310947 shobonvip A May 8, 2022, 2:56 p.m. OK PyPy 3-64 TESTS 68 608 205004800
156306875 ulyabelyaeva A May 8, 2022, 2:50 p.m. OK PyPy 3-64 TESTS 68 638 204697600
156304984 siganai A May 8, 2022, 2:47 p.m. OK PyPy 3-64 TESTS 68 655 206745600
156315331 coconut99 A May 8, 2022, 3:03 p.m. OK PyPy 3-64 TESTS 68 748 205516800
156352092 alex_mat A May 8, 2022, 5:30 p.m. OK PyPy 3-64 TESTS 68 811 205209600
156355151 titia A May 8, 2022, 6:03 p.m. OK PyPy 3-64 TESTS 68 919 204902400
156370371 Spheniscine A May 9, 2022, 12:07 a.m. OK Rust 2021 TESTS 68 77 307200
156375565 Spheniscine A May 9, 2022, 2:30 a.m. OK Rust 2021 TESTS 68 78 204800
156372783 Spheniscine A May 9, 2022, 1:33 a.m. OK Rust 2021 TESTS 68 78 204800
156299278 qwerty787788 A May 8, 2022, 2:41 p.m. OK Rust 2021 TESTS 68 202 200499200
156301878 sansen A May 8, 2022, 2:44 p.m. OK Rust 2021 TESTS 68 327 100556800
156308194 Spheniscine A May 8, 2022, 2:51 p.m. OK Rust 2021 TESTS 68 780 204800

remove filters

Back to search problems