Codeforces Round 721 (Div. 2)

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
1527 Codeforces Round 721 (Div. 2) FINISHED False 7200 110301899 May 20, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13644 ) C Sequence Pair Weight PROGRAMMING implementation math 1600

B'The weight of a sequence is defined as the number of unordered pairs of indexes (i,j) (here i lt j ) with same value ( a_{i} = a_{j} ). For example, the weight of sequence a = [1, 1, 2, 2, 1] is 4 . The set of unordered pairs of indexes with same value are (1, 2) , (1, 5) , (2, 5) , and (3, 4) . You are given a sequence a of n integers. Print the sum of the weight of all subsegments of a . A sequence b is a subsegment of a sequence a if b can be obtained from a by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^5 ). Description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 10^5 ). The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ). It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, print a single integer -- the sum of the weight of all subsegments of a . '...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
116874299 litanghui0000 C May 21, 2021, 3:57 a.m. OK GNU C++11 TESTS 72 46 614400 1600
116871220 fishcathu. C May 21, 2021, 3:05 a.m. OK GNU C++11 TESTS 72 46 1638400 1600
116845663 li0201 C May 20, 2021, 5:36 p.m. OK GNU C++11 TESTS 72 46 1638400 1600
116865483 Josh_Shu_ C May 21, 2021, 12:30 a.m. OK GNU C++11 TESTS 72 46 1945600 1600
116871253 xuanyuan C May 21, 2021, 3:06 a.m. OK GNU C++11 TESTS 72 46 15872000 1600
116865440 RPChe_ Social_Zhao dottle C May 21, 2021, 12:29 a.m. OK GNU C++11 TESTS 72 61 2457600 1600
116864442 limpid C May 20, 2021, 11:43 p.m. OK GNU C++11 TESTS 72 61 6246400 1600
116868267 Tiancaizhi C May 21, 2021, 2:05 a.m. OK GNU C++11 TESTS 72 61 6348800 1600
116881501 wanshe C May 21, 2021, 5:40 a.m. OK GNU C++11 TESTS 72 61 6451200 1600
116866767 chen_hx C May 21, 2021, 1:18 a.m. OK GNU C++11 TESTS 72 62 1638400 1600
116867491 SupremeMasterFirstClass C May 21, 2021, 1:43 a.m. OK GNU C++14 TESTS 72 62 2662400 1600
116855802 Hirbad C May 20, 2021, 7:29 p.m. OK GNU C++14 TESTS 72 62 4403200 1600
116875075 mokshith002 C May 21, 2021, 4:09 a.m. OK GNU C++14 TESTS 72 77 1638400 1600
116878363 _greymatter C May 21, 2021, 4:57 a.m. OK GNU C++14 TESTS 72 77 4096000 1600
116851449 Charbel11 C May 20, 2021, 6:26 p.m. OK GNU C++14 TESTS 72 77 4505600 1600
116867587 tanvirshossain C May 21, 2021, 1:46 a.m. OK GNU C++14 TESTS 72 77 4608000 1600
116881301 vishesh.anand C May 21, 2021, 5:37 a.m. OK GNU C++14 TESTS 72 77 4812800 1600
116881636 kausar_ahamed C May 21, 2021, 5:41 a.m. OK GNU C++14 TESTS 72 77 4915200 1600
116879394 _shin C May 21, 2021, 5:12 a.m. OK GNU C++14 TESTS 72 77 5017600 1600
116845851 Conqueror_N2N C May 20, 2021, 5:37 p.m. OK GNU C++14 TESTS 72 77 5017600 1600
116850433 JSON-558 C May 20, 2021, 6:16 p.m. OK GNU C++17 TESTS 72 62 1740800 1600
116879802 RainAir C May 21, 2021, 5:18 a.m. OK GNU C++17 TESTS 72 77 1638400 1600
116866222 Hex1234567 C May 21, 2021, 1 a.m. OK GNU C++17 TESTS 72 77 1843200 1600
116853336 nirjhorJU C May 20, 2021, 6:50 p.m. OK GNU C++17 TESTS 72 77 4198400 1600
116872827 Soul_Of_God C May 21, 2021, 3:33 a.m. OK GNU C++17 TESTS 72 77 4608000 1600
116846289 amurto C May 20, 2021, 5:40 p.m. OK GNU C++17 TESTS 72 77 4608000 1600
116882475 tushargupta.tg2609 C May 21, 2021, 5:52 a.m. OK GNU C++17 TESTS 72 77 5017600 1600
116874825 krish_murarka C May 21, 2021, 4:05 a.m. OK GNU C++17 TESTS 72 77 5017600 1600
116865528 pasricha_dhruv C May 21, 2021, 12:31 a.m. OK GNU C++17 TESTS 72 77 5017600 1600
116844753 cout--vaibhav C May 20, 2021, 5:33 p.m. OK GNU C++17 TESTS 72 77 5017600 1600
116876989 trieboi C May 21, 2021, 4:38 a.m. OK GNU C++17 (64) TESTS 72 46 1638400 1600
116865416 bkifhr10 C May 21, 2021, 12:28 a.m. OK GNU C++17 (64) TESTS 72 61 4403200 1600
116866337 LoseUFaith C May 21, 2021, 1:04 a.m. OK GNU C++17 (64) TESTS 72 61 6553600 1600
116868723 wistful23 C May 21, 2021, 2:15 a.m. OK GNU C++17 (64) TESTS 72 62 4403200 1600
116879240 old._.monk C May 21, 2021, 5:10 a.m. OK GNU C++17 (64) TESTS 72 62 5222400 1600
116845029 manupathria C May 20, 2021, 5:34 p.m. OK GNU C++17 (64) TESTS 72 62 5222400 1600
116851851 Beas C May 20, 2021, 6:31 p.m. OK GNU C++17 (64) TESTS 72 62 5939200 1600
116866585 youtsuha C May 21, 2021, 1:12 a.m. OK GNU C++17 (64) TESTS 72 62 6451200 1600
116851222 Amz42 C May 20, 2021, 6:24 p.m. OK GNU C++17 (64) TESTS 72 62 6451200 1600
116872270 DanielMontes C May 21, 2021, 3:24 a.m. OK GNU C++17 (64) TESTS 72 62 6860800 1600
116873305 0x3F C May 21, 2021, 3:41 a.m. OK Go TESTS 72 124 6348800 1600
116851906 ytripathi891 C May 20, 2021, 6:32 p.m. OK Java 11 TESTS 72 218 4608000 1600
116877925 ujjwalavishek C May 21, 2021, 4:51 a.m. OK Java 11 TESTS 72 218 5734400 1600
116858390 MrOtter C May 20, 2021, 8:17 p.m. OK Java 11 TESTS 72 249 2252800 1600
116850878 MubtasimShahriar C May 20, 2021, 6:21 p.m. OK Java 11 TESTS 72 249 4915200 1600
116880654 Sachin_2961 C May 21, 2021, 5:29 a.m. OK Java 11 TESTS 72 264 1740800 1600
116876848 sumitchavan C May 21, 2021, 4:36 a.m. OK Java 11 TESTS 72 265 1638400 1600
116861196 qwerty12345qwerty C May 20, 2021, 9:27 p.m. OK Java 11 TESTS 72 296 13824000 1600
116880216 saurabh_kl C May 21, 2021, 5:23 a.m. OK Java 11 TESTS 72 311 14745600 1600
116871189 kishorekumar21 C May 21, 2021, 3:05 a.m. OK Java 11 TESTS 72 327 9523200 1600
116880941 Tharun0102 C May 21, 2021, 5:33 a.m. OK Java 11 TESTS 72 327 13824000 1600
116877019 BestEveryman C May 21, 2021, 4:38 a.m. OK Java 8 TESTS 72 202 5222400 1600
116849446 kzhang2012 C May 20, 2021, 6:05 p.m. OK Java 8 TESTS 72 218 3276800 1600
116860469 Sandip_Jana C May 20, 2021, 9:07 p.m. OK Java 8 TESTS 72 218 14233600 1600
116840261 honeysingh18 C May 20, 2021, 4:32 p.m. OK Java 8 TESTS 72 249 20582400 1600
116845544 RonWonWon C May 20, 2021, 5:36 p.m. OK Java 8 TESTS 72 280 19456000 1600
116848688 RonWonWon C May 20, 2021, 5:59 p.m. OK Java 8 TESTS 72 280 19558400 1600
116874382 Akshay211 C May 21, 2021, 3:59 a.m. OK Java 8 TESTS 72 311 20787200 1600
116874309 Akshay211 C May 21, 2021, 3:57 a.m. OK Java 8 TESTS 72 312 20684800 1600
116874040 Akshay211 C May 21, 2021, 3:53 a.m. OK Java 8 TESTS 72 405 36864000 1600
116875976 atish1999 C May 21, 2021, 4:24 a.m. OK Java 8 TESTS 72 483 5734400 1600
116873907 pallav12 C May 21, 2021, 3:51 a.m. OK Kotlin TESTS 72 810 12800000 1600
116878155 codersanjeev C May 21, 2021, 4:54 a.m. OK Kotlin TESTS 72 826 8704000 1600
116847472 cosinechicken C May 20, 2021, 5:49 p.m. OK MS C++ 2017 TESTS 72 218 4300800 1600
116860250 henrychenOutlook C May 20, 2021, 9:01 p.m. OK Node.js TESTS 72 826 28160000 1600
116859919 henrychenOutlook C May 20, 2021, 8:51 p.m. OK Node.js TESTS 72 888 29388800 1600
116874518 rishabnahar2025 C May 21, 2021, 4:01 a.m. OK PyPy 2 TESTS 72 280 17612800 1600
116880059 s_prateek26 C May 21, 2021, 5:21 a.m. OK PyPy 3 TESTS 72 218 14848000 1600
116846783 nitish420 C May 20, 2021, 5:44 p.m. OK PyPy 3 TESTS 72 233 16384000 1600
116878443 aayush_1607 C May 21, 2021, 4:58 a.m. OK PyPy 3 TESTS 72 249 13721600 1600
116851267 dufresne_1949 C May 20, 2021, 6:25 p.m. OK PyPy 3 TESTS 72 265 14745600 1600
116846749 ghodabkl C May 20, 2021, 5:43 p.m. OK PyPy 3 TESTS 72 265 14745600 1600
116872020 kirito18086 C May 21, 2021, 3:20 a.m. OK PyPy 3 TESTS 72 295 17100800 1600
116865707 FlakeLCR C May 21, 2021, 12:39 a.m. OK PyPy 3 TESTS 72 296 14131200 1600
116852117 EpicChadGamer C May 20, 2021, 6:34 p.m. OK PyPy 3 TESTS 72 311 12800000 1600
116857047 im__skp C May 20, 2021, 7:50 p.m. OK PyPy 3 TESTS 72 311 12902400 1600
116864098 asheux C May 20, 2021, 11:27 p.m. OK PyPy 3 TESTS 72 326 13004800 1600
116879079 orailly C May 21, 2021, 5:08 a.m. OK Python 3 TESTS 72 327 11980800 1600
116855798 praneethvasa C May 20, 2021, 7:29 p.m. OK Python 3 TESTS 72 389 10444800 1600
116879889 Gauranshu C May 21, 2021, 5:19 a.m. OK Python 3 TESTS 72 451 10137600 1600
116851020 KanishkGoel C May 20, 2021, 6:22 p.m. OK Python 3 TESTS 72 1091 10035200 1600
116849095 games.princeraj C May 20, 2021, 6:02 p.m. OK Python 3 TESTS 72 1107 14028800 1600
116855408 SKA1812 C May 20, 2021, 7:23 p.m. OK Python 3 TESTS 72 1138 10444800 1600
116873814 WhatsDerivative C May 21, 2021, 3:49 a.m. OK Python 3 TESTS 72 1169 14950400 1600
116858252 newbie00 C May 20, 2021, 8:14 p.m. OK Python 3 TESTS 72 1170 9113600 1600
116877071 phantomxxx C May 21, 2021, 4:39 a.m. OK Python 3 TESTS 72 1200 9523200 1600
116876955 ujjwalavishek C May 21, 2021, 4:38 a.m. OK Python 3 TESTS 72 1200 10649600 1600
116855855 praneethvasa C May 20, 2021, 7:30 p.m. OK Python 3 + libs TESTS 72 312 0 1600
116878060 gipsyh C May 21, 2021, 4:53 a.m. OK Rust TESTS 72 889 3788800 1600
116881165 gipsyh C May 21, 2021, 5:35 a.m. OK Rust TESTS 72 920 3788800 1600

remove filters

Back to search problems