Codeforces Round 673 (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
1416 Codeforces Round 673 (Div. 1) FINISHED False 7200 130604099 Sept. 27, 2020, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4473 ) C XOR Inverse PROGRAMMING bitmasks data structures divide and conquer greedy strings trees 2000

B'You are given an array a consisting of n non-negative integers. You have to choose a non-negative integer x and form a new array b of size n according to the following rule: for all i from 1 to n , b_i = a_i oplus x ( oplus denotes the operation bitwise XOR). An inversion in the b array is a pair of integers i and j such that 1 <= i < j <= n and b_i > b_j . You should choose x in such a way that the number of inversions in b is minimized. If there are several options for x -- output the smallest one. First line contains a single integer n ( 1 <= n <= 3 cdot 10^5 ) -- the number of elements in a . Second line contains n space-separated integers a_1 , a_2 , ..., a_n ( 0 <= a_i <= 10^9 ), where a_i is the i -th element of a . Output two integers: the minimum possible number of inversions in b , and the minimum possible value of x , which achieves those number of inversions. In the first sample it is optimal to leave the array as it is by choosing x = 0 . In the second sample the selection of x = 14 results in b : [4, 9, 7, 4, 9, 11, 11, 13, 11] . It has 4 inversions: In the third sample the selection of x = 8 results in b : [0, 2, 11] . It has no inversions. '...

Tutorials

Codeforces Round #673 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
93987150 Gassa C Sept. 27, 2020, 3:36 p.m. OK D TESTS 43 1356 13516800 2000
94048676 OMG_link C Sept. 28, 2020, 4:58 a.m. OK GNU C++11 TESTS 44 109 73216000 2000
93981860 lzr_010506 C Sept. 27, 2020, 3:26 p.m. OK GNU C++11 TESTS 43 140 120320000 2000
93982861 KagamineRin C Sept. 27, 2020, 3:27 p.m. OK GNU C++11 TESTS 43 155 4608000 2000
94041562 axiomofchoice C Sept. 28, 2020, 2:13 a.m. OK GNU C++11 TESTS 44 171 2457600 2000
93990869 emofunc C Sept. 27, 2020, 3:44 p.m. OK GNU C++11 TESTS 43 171 3584000 2000
94041556 2018LZY C Sept. 28, 2020, 2:13 a.m. OK GNU C++11 TESTS 44 171 9625600 2000
93991868 2016wudi C Sept. 27, 2020, 3:46 p.m. OK GNU C++11 TESTS 43 187 2252800 2000
94000931 srijon51 C Sept. 27, 2020, 4:09 p.m. OK GNU C++11 TESTS 43 187 2457600 2000
94041389 2018LZY C Sept. 28, 2020, 2:08 a.m. OK GNU C++11 TESTS 44 187 9625600 2000
93989272 Misaka-Mikoto- C Sept. 27, 2020, 3:40 p.m. OK GNU C++11 TESTS 43 187 127488000 2000
93988789 CodePlatina C Sept. 27, 2020, 3:39 p.m. OK GNU C++14 TESTS 43 171 4915200 2000
94000092 hamlet C Sept. 27, 2020, 4:07 p.m. OK GNU C++14 TESTS 43 202 2457600 2000
94038281 kkqq C Sept. 28, 2020, 12:15 a.m. OK GNU C++14 TESTS 44 218 16281600 2000
94027475 purinliang C Sept. 27, 2020, 6:53 p.m. OK GNU C++14 TESTS 44 233 2662400 2000
94018123 taehoon1310 C Sept. 27, 2020, 5:01 p.m. OK GNU C++14 TESTS 43 233 9011200 2000
93987367 He_Ren C Sept. 27, 2020, 3:37 p.m. OK GNU C++14 TESTS 43 234 76902400 2000
94021831 MYNAMEISSHARIFUL C Sept. 27, 2020, 5:45 p.m. OK GNU C++14 TESTS 43 249 31027200 2000
93983934 MURAT_ECEM_EKICI C Sept. 27, 2020, 3:30 p.m. OK GNU C++14 TESTS 43 265 240742400 2000
94026706 purinliang C Sept. 27, 2020, 6:40 p.m. OK GNU C++14 TESTS 44 280 2662400 2000
94006323 skydog C Sept. 27, 2020, 4:25 p.m. OK GNU C++14 TESTS 43 280 5324800 2000
94001315 gzchenyin C Sept. 27, 2020, 4:10 p.m. OK GNU C++17 TESTS 43 171 3891200 2000
93997174 dmkozyrev C Sept. 27, 2020, 3:59 p.m. OK GNU C++17 TESTS 43 186 4915200 2000
94021960 Lgq_3de5 C Sept. 27, 2020, 5:46 p.m. OK GNU C++17 TESTS 43 187 10035200 2000
93989298 dreamoon_love_AA C Sept. 27, 2020, 3:40 p.m. OK GNU C++17 TESTS 43 187 65126400 2000
93997954 polinarria C Sept. 27, 2020, 4:01 p.m. OK GNU C++17 TESTS 43 202 2457600 2000
93986076 freak93 C Sept. 27, 2020, 3:34 p.m. OK GNU C++17 TESTS 43 202 2457600 2000
94005596 qhqh C Sept. 27, 2020, 4:23 p.m. OK GNU C++17 TESTS 43 202 4812800 2000
94014121 _oscar_S21 C Sept. 27, 2020, 4:50 p.m. OK GNU C++17 TESTS 43 217 61849600 2000
94010088 Whalanator C Sept. 27, 2020, 4:37 p.m. OK GNU C++17 TESTS 43 218 4812800 2000
93995858 Bohun C Sept. 27, 2020, 3:56 p.m. OK GNU C++17 TESTS 43 218 216473600 2000
94043418 emengdeath C Sept. 28, 2020, 3:03 a.m. OK GNU C++17 (64) TESTS 44 140 5529600 2000
93988043 RobeZH C Sept. 27, 2020, 3:38 p.m. OK GNU C++17 (64) TESTS 43 156 2457600 2000
93996081 ALILILILILI-KHAN C Sept. 27, 2020, 3:56 p.m. OK GNU C++17 (64) TESTS 43 156 4812800 2000
94039594 kessido C Sept. 28, 2020, 1:07 a.m. OK GNU C++17 (64) TESTS 44 156 59699200 2000
94027553 antguz C Sept. 27, 2020, 6:54 p.m. OK GNU C++17 (64) TESTS 44 171 7270400 2000
94040971 zhouzhendong C Sept. 28, 2020, 1:53 a.m. OK GNU C++17 (64) TESTS 44 187 3584000 2000
94018656 wasvlad C Sept. 27, 2020, 5:02 p.m. OK GNU C++17 (64) TESTS 43 187 123289600 2000
94044105 DimmyT C Sept. 28, 2020, 3:21 a.m. OK GNU C++17 (64) TESTS 44 217 9830400 2000
94029923 smax C Sept. 27, 2020, 7:39 p.m. OK GNU C++17 (64) TESTS 44 217 108236800 2000
93993591 adamant C Sept. 27, 2020, 3:50 p.m. OK GNU C++17 (64) TESTS 43 217 232140800 2000
94003214 Xylenox C Sept. 27, 2020, 4:16 p.m. OK Go TESTS 43 499 6553600 2000
94004812 uwi C Sept. 27, 2020, 4:21 p.m. OK Java 11 TESTS 43 326 0 2000
94021500 Agnimandur C Sept. 27, 2020, 5:43 p.m. OK Java 11 TESTS 43 904 19865600 2000
94002935 cirno3153 C Sept. 27, 2020, 4:15 p.m. OK Java 11 TESTS 43 1388 38912000 2000
94051646 adp527 C Sept. 28, 2020, 5:50 a.m. OK Java 11 TESTS 44 1622 256102400 2000
94022637 skittles1412 C Sept. 27, 2020, 5:51 p.m. OK Java 11 TESTS 43 1902 23040000 2000
94022342 skittles1412 C Sept. 27, 2020, 5:49 p.m. OK Java 11 TESTS 43 1949 28672000 2000
94023036 skittles1412 C Sept. 27, 2020, 5:55 p.m. OK Java 11 TESTS 43 1980 20684800 2000
94011943 mikit C Sept. 27, 2020, 4:43 p.m. OK Java 11 TESTS 43 1981 4300800 2000
94022166 skittles1412 C Sept. 27, 2020, 5:48 p.m. OK Java 11 TESTS 43 1996 29696000 2000
93985784 iakovlev.zakhar C Sept. 27, 2020, 3:33 p.m. OK Java 11 TESTS 43 1996 31539200 2000
94013978 YahiaSherif C Sept. 27, 2020, 4:49 p.m. OK Java 8 TESTS 43 390 15564800 2000
94000716 fetetriste C Sept. 27, 2020, 4:09 p.m. OK Java 8 TESTS 43 405 219136000 2000
94005724 Sharon C Sept. 27, 2020, 4:23 p.m. OK Java 8 TESTS 43 483 7065600 2000
93998528 SecondThread C Sept. 27, 2020, 4:03 p.m. OK Java 8 TESTS 43 546 375603200 2000
94007889 TheSawan C Sept. 27, 2020, 4:30 p.m. OK Java 8 TESTS 43 717 26624000 2000
94035375 polyakoff C Sept. 27, 2020, 10:04 p.m. OK Java 8 TESTS 44 732 41676800 2000
93994670 AnandOza C Sept. 27, 2020, 3:53 p.m. OK Java 8 TESTS 43 811 31334400 2000
94040925 MagentaCobra C Sept. 28, 2020, 1:51 a.m. OK Java 8 TESTS 44 888 11776000 2000
94004470 ijxjdjd C Sept. 27, 2020, 4:20 p.m. OK Java 8 TESTS 43 904 28057600 2000
94025345 martins C Sept. 27, 2020, 6:22 p.m. OK Java 8 TESTS 43 1590 18022400 2000
94012047 azukun C Sept. 27, 2020, 4:43 p.m. OK Mono C# TESTS 43 592 54169600 2000
94022749 r57shell C Sept. 27, 2020, 5:52 p.m. OK MS C++ TESTS 43 280 149094400 2000
94021464 shirowa C Sept. 27, 2020, 5:43 p.m. OK MS C++ 2017 TESTS 43 405 4812800 2000
94013412 shirowa C Sept. 27, 2020, 4:47 p.m. OK MS C++ 2017 TESTS 43 858 4812800 2000
93997525 Friska C Sept. 27, 2020, 4 p.m. OK MS C++ 2017 TESTS 43 904 111616000 2000
94021822 Seyaua C Sept. 27, 2020, 5:45 p.m. OK MS C++ 2017 TESTS 43 1185 23142400 2000
94006761 PineMarten C Sept. 27, 2020, 4:26 p.m. OK MS C++ 2017 TESTS 43 1278 111104000 2000
94027625 vpike C Sept. 27, 2020, 6:55 p.m. OK MS C++ 2017 TESTS 44 1294 6041600 2000
94002259 Gravekper C Sept. 27, 2020, 4:13 p.m. OK MS C++ 2017 TESTS 43 1388 22016000 2000
94027687 vpike C Sept. 27, 2020, 6:56 p.m. OK MS C++ 2017 TESTS 44 1434 6041600 2000
94027723 vpike C Sept. 27, 2020, 6:57 p.m. OK MS C++ 2017 TESTS 44 1450 6041600 2000
94003841 vpike C Sept. 27, 2020, 4:18 p.m. OK MS C++ 2017 TESTS 43 1497 6041600 2000
94003970 Yupiteru C Sept. 27, 2020, 4:18 p.m. OK .NET Core C# TESTS 43 1356 85606400 2000
94013135 EmK C Sept. 27, 2020, 4:46 p.m. OK .NET Core C# TESTS 43 1450 30822400 2000
94025201 EmK C Sept. 27, 2020, 6:20 p.m. OK .NET Core C# TESTS 43 1590 30822400 2000
94027829 c1729 C Sept. 27, 2020, 6:59 p.m. OK PyPy 2 TESTS 44 1325 42803200 2000
94027920 c1729 C Sept. 27, 2020, 7 p.m. OK PyPy 2 TESTS 44 1357 44339200 2000
94028255 FlakeLCR C Sept. 27, 2020, 7:06 p.m. OK PyPy 2 TESTS 44 1980 47923200 2000
94024171 kclee2172 C Sept. 27, 2020, 6:07 p.m. OK PyPy 3 TESTS 43 1045 108953600 2000
94012758 chudy_lukasz1337 C Sept. 27, 2020, 4:46 p.m. OK PyPy 3 TESTS 43 1325 108236800 2000
94013692 SPD_9X2 C Sept. 27, 2020, 4:48 p.m. OK PyPy 3 TESTS 43 1356 102297600 2000
94028234 throwawayatcoder C Sept. 27, 2020, 7:06 p.m. OK PyPy 3 TESTS 44 1372 93798400 2000
94013661 yuusanlondon C Sept. 27, 2020, 4:48 p.m. OK PyPy 3 TESTS 43 1418 40140800 2000
94029486 Kira_1234 C Sept. 27, 2020, 7:30 p.m. OK PyPy 3 TESTS 44 1497 68198400 2000
94022122 nagiss C Sept. 27, 2020, 5:47 p.m. OK PyPy 3 TESTS 43 1560 74240000 2000
94002824 neterukun C Sept. 27, 2020, 4:15 p.m. OK PyPy 3 TESTS 43 1622 112844800 2000
93983565 conqueror_of_tourist C Sept. 27, 2020, 3:29 p.m. OK PyPy 3 TESTS 43 1684 60211200 2000
94023211 nagiss C Sept. 27, 2020, 5:56 p.m. OK PyPy 3 TESTS 43 1684 73523200 2000
94038148 sansen C Sept. 28, 2020, 12:09 a.m. OK Rust TESTS 44 295 15667200 2000
94009047 tuna_salad C Sept. 27, 2020, 4:34 p.m. OK Rust TESTS 43 483 27340800 2000
93989072 sansen C Sept. 27, 2020, 3:40 p.m. OK Rust TESTS 43 483 29593600 2000
94023848 pandrei C Sept. 27, 2020, 6:02 p.m. OK Rust TESTS 43 826 42393600 2000
94022546 EbTech C Sept. 27, 2020, 5:50 p.m. OK Rust TESTS 43 1465 21913600 2000
93984515 EbTech C Sept. 27, 2020, 3:31 p.m. OK Rust TESTS 43 1544 22016000 2000

remove filters

Back to search problems