Codeforces Round 867 (Div. 3)

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
1822 Codeforces Round 867 (Div. 3) FINISHED False 8100 54833063 April 24, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2503 ) G2 Magic Triples (Hard Version) PROGRAMMING brute force math number theory

B'This is the hard version of the problem. The only difference is that in this version, a_i <= 10^9 . For a given sequence of n integers a , a triple (i, j, k) is called magic if: Kolya received a sequence of integers a as a gift and now wants to count the number of magic triples for it. Help him with this task! Note that there are no constraints on the order of integers i , j and k . The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of the test case contains a single integer n ( 3 <= n <= 2 cdot 10^5 ) -- the length of the sequence. The second line of the test contains n integers a_1, a_2, a_3, ... , a_n ( 1 <= a_i <= 10^9 ) -- the elements of the sequence a . The sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a single integer -- the number of magic triples for the sequence a . In the first example, there are 6 magic triples for the sequence a -- (2, 3, 5) , (2, 5, 3) , (3, 2, 5) , (3, 5, 2) , (5, 2, 3) , (5, 3, 2) . In the second example, there is a single magic triple for the sequence a -- (2, 1, 3) . '...

Tutorials

Codeforces Round #867 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
203399731 Cu_OH_2 G2 April 25, 2023, 5:51 a.m. OK GNU C++14 TESTS 62 483 8294400
203346988 8528190042DucLA1 G2 April 24, 2023, 5 p.m. OK GNU C++14 TESTS 32 1123 7372800
203390456 Kaibad G2 April 25, 2023, 3:34 a.m. OK GNU C++14 TESTS 47 1435 11161600
203379727 DitaMirika G2 April 25, 2023, 12:05 a.m. OK GNU C++14 TESTS 47 1559 6553600
203389393 qyf700 G2 April 25, 2023, 3:18 a.m. OK GNU C++14 TESTS 47 1560 9830400
203389563 Kaibad G2 April 25, 2023, 3:20 a.m. OK GNU C++14 TESTS 47 1731 11161600
203385674 tahoangquan2 G2 April 25, 2023, 2:14 a.m. OK GNU C++14 TESTS 47 1777 16281600
203390685 Kaibad G2 April 25, 2023, 3:37 a.m. OK GNU C++14 TESTS 47 1809 11161600
203372516 Space-Time- G2 April 24, 2023, 9:24 p.m. OK GNU C++14 TESTS 47 1809 21811200
203386108 kevco G2 April 25, 2023, 2:21 a.m. OK GNU C++14 TESTS 47 1918 7475200
203370001 Ghost_in_LCL G2 April 24, 2023, 8:43 p.m. OK GNU C++17 TESTS 34 623 14745600
203351143 asiad G2 April 24, 2023, 5:24 p.m. OK GNU C++17 TESTS 34 795 13209600
203398225 Lihg G2 April 25, 2023, 5:30 a.m. OK GNU C++17 TESTS 62 826 7372800
203378657 DeadlyPillow G2 April 24, 2023, 11:38 p.m. OK GNU C++17 TESTS 47 857 58572800
203380606 asiad G2 April 25, 2023, 12:25 a.m. OK GNU C++17 TESTS 47 919 13824000
203391880 yang12138 G2 April 25, 2023, 3:54 a.m. OK GNU C++17 TESTS 47 935 227942400
203392988 meispi G2 April 25, 2023, 4:12 a.m. OK GNU C++17 TESTS 47 951 7168000
203365014 MAXsn G2 April 24, 2023, 7:35 p.m. OK GNU C++17 TESTS 34 951 10137600
203364712 MAXsn G2 April 24, 2023, 7:31 p.m. OK GNU C++17 TESTS 34 967 10137600
203365336 MAXsn G2 April 24, 2023, 7:39 p.m. OK GNU C++17 TESTS 34 982 10137600
203382527 yangjl G2 April 25, 2023, 1:08 a.m. OK GNU C++17 (64) TESTS 47 919 10444800
203347499 Andrey23 G2 April 24, 2023, 5:03 p.m. OK GNU C++17 (64) TESTS 32 1060 10444800
203393788 kdlive G2 April 25, 2023, 4:24 a.m. OK GNU C++17 (64) TESTS 47 1075 10035200
203355521 Owmicron G2 April 24, 2023, 5:59 p.m. OK GNU C++17 (64) TESTS 34 1310 9728000
203360172 wa_wa_vegetable G2 April 24, 2023, 6:44 p.m. OK GNU C++17 (64) TESTS 34 1357 10854400
203392946 Sempr G2 April 25, 2023, 4:11 a.m. OK GNU C++17 (64) TESTS 47 1404 83148800
203400369 yiyiyize G2 April 25, 2023, 6 a.m. OK GNU C++17 (64) TESTS 62 1435 12902400
203387411 HillSideDonkey G2 April 25, 2023, 2:46 a.m. OK GNU C++17 (64) TESTS 47 1466 83148800
203400468 yiyiyize G2 April 25, 2023, 6:01 a.m. OK GNU C++17 (64) TESTS 62 1496 12902400
203387040 HillSideDonkey G2 April 25, 2023, 2:40 a.m. OK GNU C++17 (64) TESTS 47 1559 83251200
203369268 AlperenT G2 April 24, 2023, 8:33 p.m. OK GNU C++20 (64) TESTS 34 187 5017600
203369563 AlperenT G2 April 24, 2023, 8:37 p.m. OK GNU C++20 (64) TESTS 34 202 5017600
203369351 AlperenT G2 April 24, 2023, 8:34 p.m. OK GNU C++20 (64) TESTS 34 202 5017600
203361928 fishcathu. G2 April 24, 2023, 7:01 p.m. OK GNU C++20 (64) TESTS 34 249 819200
203362894 fishcathu. G2 April 24, 2023, 7:11 p.m. OK GNU C++20 (64) TESTS 34 265 819200
203362529 fishcathu. G2 April 24, 2023, 7:08 p.m. OK GNU C++20 (64) TESTS 34 265 819200
203361801 fishcathu. G2 April 24, 2023, 7 p.m. OK GNU C++20 (64) TESTS 34 265 819200
203368020 AlperenT G2 April 24, 2023, 8:14 p.m. OK GNU C++20 (64) TESTS 34 265 5017600
203361475 fishcathu. G2 April 24, 2023, 6:57 p.m. OK GNU C++20 (64) TESTS 34 280 819200
203361371 fishcathu. G2 April 24, 2023, 6:55 p.m. OK GNU C++20 (64) TESTS 34 296 819200
203398249 0x3F G2 April 25, 2023, 5:30 a.m. OK Go TESTS 62 717 12800000
203396754 0x3F G2 April 25, 2023, 5:10 a.m. OK Go TESTS 47 717 12800000
203355444 blue_ice_yj G2 April 24, 2023, 5:58 p.m. OK Go TESTS 34 842 8089600
203368285 liangjiahui11 G2 April 24, 2023, 8:18 p.m. OK Go TESTS 34 1310 19148800
203361286 SkadiTheCorruptHeart G2 April 24, 2023, 6:54 p.m. OK Java 11 TESTS 34 1231 19763200
203363719 dzhi G2 April 24, 2023, 7:20 p.m. OK Java 11 TESTS 34 2729 10444800
203353126 Andrei_Kuz G2 April 24, 2023, 5:39 p.m. OK Java 17 TESTS 34 2511 213913600
203350836 mumuxinfei G2 April 24, 2023, 5:22 p.m. OK Java 17 TESTS 34 2823 10547200
203349526 mumuxinfei G2 April 24, 2023, 5:14 p.m. OK Java 17 TESTS 34 2900 11366400
203372718 aruniscoding G2 April 24, 2023, 9:27 p.m. OK Java 17 TESTS 47 3041 9216000
203394612 IanISam G2 April 25, 2023, 4:38 a.m. OK Java 8 TESTS 47 1060 17920000
203397750 IanISam G2 April 25, 2023, 5:24 a.m. OK Java 8 TESTS 47 1153 18534400
203394475 IanISam G2 April 25, 2023, 4:35 a.m. OK Java 8 TESTS 47 1185 17920000
203397847 IanISam G2 April 25, 2023, 5:25 a.m. OK Java 8 TESTS 47 1450 17920000
203397516 IanISam G2 April 25, 2023, 5:21 a.m. OK Java 8 TESTS 47 1684 17920000
203396993 IanISam G2 April 25, 2023, 5:13 a.m. OK Java 8 TESTS 47 1699 18022400
203393685 IanISam G2 April 25, 2023, 4:23 a.m. OK Java 8 TESTS 47 1840 17817600
203391098 IanISam G2 April 25, 2023, 3:42 a.m. OK Java 8 TESTS 47 1840 22835200
203397402 IanISam G2 April 25, 2023, 5:19 a.m. OK Java 8 TESTS 47 1918 18022400
203397231 IanISam G2 April 25, 2023, 5:16 a.m. OK Java 8 TESTS 47 1918 18022400
203381621 RobinFromTheHood G2 April 25, 2023, 12:47 a.m. OK PyPy 3-64 TESTS 47 483 35840000
203382594 RobinFromTheHood G2 April 25, 2023, 1:09 a.m. OK PyPy 3-64 TESTS 47 514 32563200
203377239 liupengsay G2 April 24, 2023, 11:05 p.m. OK PyPy 3-64 TESTS 47 1107 40038400
203375564 nush24 G2 April 24, 2023, 10:27 p.m. OK PyPy 3-64 TESTS 47 1107 40038400
203378581 liupengsay G2 April 24, 2023, 11:36 p.m. OK PyPy 3-64 TESTS 47 1122 41267200
203372979 hxu10 G2 April 24, 2023, 9:32 p.m. OK PyPy 3-64 TESTS 47 1169 41267200
203378829 liupengsay G2 April 24, 2023, 11:42 p.m. OK PyPy 3-64 TESTS 47 1263 39833600
203385527 RobinFromTheHood G2 April 25, 2023, 2:11 a.m. OK PyPy 3-64 TESTS 47 1278 33280000
203398209 gardengnome G2 April 25, 2023, 5:30 a.m. OK PyPy 3-64 TESTS 62 1294 34406400
203357184 SulaymanovIrsdavlat G2 April 24, 2023, 6:14 p.m. OK PyPy 3-64 TESTS 34 1341 43827200
203356810 0npata G2 April 24, 2023, 6:11 p.m. OK Rust 2021 TESTS 34 920 12390400
203351075 RustIsBestLang G2 April 24, 2023, 5:24 p.m. OK Rust 2021 TESTS 34 1044 12492800
203396034 cpchenpi G2 April 25, 2023, 4:59 a.m. OK Rust 2021 TESTS 47 1544 12492800

remove filters

Back to search problems