Codeforces Round 516 (Div. 2, by Moscow Team Olympiad)

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
1064 Codeforces Round 516 (Div. 2, by Moscow Team Olympiad) FINISHED False 7200 198014124 Oct. 14, 2018, 10:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7598 ) B Equations of Mathematical Magic PROGRAMMING math 1200

B'Reading the book "Equations of Mathematical Magic" Roman Oira-Oira and Cristobal Junta found an interesting equation: a - (a oplus x) - x = 0 for some given a , where oplus stands for a bitwise exclusive or (XOR) of two integers (this operation is denoted as ^ or xor in many modern programming languages). Oira-Oira quickly found some x , which is the solution of the equation, but Cristobal Junta decided that Oira-Oira 's result is not interesting enough, so he asked his colleague how many non-negative solutions of this equation exist. This task turned out to be too difficult for Oira-Oira, so he asks you to help. Each test contains several possible values of a and your task is to find the number of equation 's solution for each of them. The first line contains an integer t ( 1 <= t <= 1000 ) -- the number of these values. The following t lines contain the values of parameter a , each value is an integer from 0 to 2^{30} - 1 inclusive. For each value of a print exactly one integer -- the number of non-negative solutions of the equation for the given value of the parameter. Print answers in the same order as values of a appear in the input. One can show that the number of solutions is always finite. Let 's define the bitwise exclusive OR (XOR) operation. Given two integers x and y , consider their binary representations (possibly with leading zeroes): x_k ... x_2 x_1 x_0 and y_k ... y_2 y_1 y_0 . Here, x_i is the i -th bit of the number x and y_i is the i -th bit of the number y . Let r = x oplus y be the result of the XOR operation of x and y . Then r is defined as r_k ... r_2 r_1 r_0 where: r_i = <= ft { begin{aligned} 1, ~ text{if} ~ x_i ne y_i 0, ~ text{if} ~ x_i = y_i end{aligned} right. For the first value of the parameter, only x = 0 is a solution of the eq'...

Tutorials

Codeforces Round #516 (by Moscow Team Olympiad) — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
50077446 yp0413170337 B Feb. 17, 2019, 11:35 p.m. OK Clang++17 Diagnostics TESTS 7 46 0 1200
45036208 AshutoshAnshul B Oct. 29, 2018, 7:51 a.m. OK Clang++17 Diagnostics TESTS 7 46 307200 1200
44373933 abdelkarim B Oct. 15, 2018, 8:05 p.m. OK Clang++17 Diagnostics TESTS 7 61 307200 1200
62387210 vjudge5 B Oct. 11, 2019, 10:14 p.m. OK Clang++17 Diagnostics TESTS 7 62 1024000 1200
45566358 nanae1914 B Nov. 11, 2018, 2:46 p.m. OK D TESTS 7 15 0 1200
44295571 ruban B Oct. 14, 2018, 10:17 a.m. OK Delphi TESTS 7 31 9113600 1200
44297887 sfs B Oct. 14, 2018, 10:26 a.m. OK FPC TESTS 7 15 0 1200
44310157 PandaIsTheBest B Oct. 14, 2018, 11:33 a.m. OK FPC TESTS 7 15 0 1200
44472200 luogu_bot2 B Oct. 18, 2018, 6:57 a.m. OK FPC TESTS 7 15 0 1200
44298189 keletou B Oct. 14, 2018, 10:28 a.m. OK FPC TESTS 7 30 0 1200
45798670 nasway B Nov. 16, 2018, 12:11 p.m. OK FPC TESTS 7 31 0 1200
44696118 vjudge4 B Oct. 22, 2018, 1:02 p.m. OK FPC TESTS 7 31 0 1200
44695856 luogu_bot1 B Oct. 22, 2018, 12:58 p.m. OK FPC TESTS 7 31 0 1200
44299535 AHTOH._. B Oct. 14, 2018, 10:34 a.m. OK FPC TESTS 7 31 0 1200
44298370 107 B Oct. 14, 2018, 10:29 a.m. OK FPC TESTS 7 46 0 1200
44306084 g-moll B Oct. 14, 2018, 11:09 a.m. OK GNU C11 TESTS 7 15 0 1200
44399507 harbor B Oct. 16, 2018, 12:14 p.m. OK GNU C11 TESTS 7 15 0 1200
44707897 nikhilE1g B Oct. 22, 2018, 5:34 p.m. OK GNU C11 TESTS 7 15 0 1200
45764539 Daymaker9000 B Nov. 15, 2018, 11:30 a.m. OK GNU C11 TESTS 7 15 0 1200
48423713 NoSoul B Jan. 15, 2019, 1:55 p.m. OK GNU C11 TESTS 7 15 0 1200
44307528 akhildutt81 B Oct. 14, 2018, 11:17 a.m. OK GNU C11 TESTS 7 15 0 1200
44349235 rituraj_roy B Oct. 15, 2018, 9:08 a.m. OK GNU C11 TESTS 7 15 0 1200
46818551 WzyAXb B Dec. 9, 2018, 1:39 p.m. OK GNU C11 TESTS 7 30 0 1200
46839001 vjudge2 B Dec. 10, 2018, 5:57 a.m. OK GNU C11 TESTS 7 30 0 1200
50702563 vjudge2 B March 2, 2019, 11:37 p.m. OK GNU C11 TESTS 7 30 0 1200
54894962 ArachnidaKing B June 1, 2019, 1:32 a.m. OK GNU C++11 TESTS 7 15 0 1200
55019044 vjudge4 B June 3, 2019, 1:50 p.m. OK GNU C++11 TESTS 7 15 0 1200
57843708 luogu_bot3 B July 27, 2019, 10:15 a.m. OK GNU C++11 TESTS 7 15 0 1200
58524337 vjudge4 B Aug. 10, 2019, 6:27 a.m. OK GNU C++11 TESTS 7 15 0 1200
59193023 luogu_bot2 B Aug. 20, 2019, 11:02 p.m. OK GNU C++11 TESTS 7 15 0 1200
59426580 Alike B Aug. 25, 2019, 3:03 a.m. OK GNU C++11 TESTS 7 15 0 1200
60934997 vjudge5 B Sept. 20, 2019, 2:59 p.m. OK GNU C++11 TESTS 7 15 0 1200
63558256 alicealicealice B Oct. 27, 2019, 1:29 p.m. OK GNU C++11 TESTS 7 15 0 1200
67136571 vjudge3 B Dec. 18, 2019, 4:36 a.m. OK GNU C++11 TESTS 7 15 0 1200
69475732 tuwuna B Jan. 24, 2020, 4:06 p.m. OK GNU C++11 TESTS 7 15 0 1200
68152595 EXtreme_Evil B Jan. 4, 2020, 7:32 a.m. OK GNU C++14 TESTS 7 15 0 1200
69811673 __Stranger__ B Jan. 30, 2020, 4:38 a.m. OK GNU C++14 TESTS 7 15 0 1200
69003675 Gabriel98 B Jan. 17, 2020, 9:11 p.m. OK GNU C++14 TESTS 7 15 0 1200
68961114 vjudge4 B Jan. 17, 2020, 12:57 a.m. OK GNU C++14 TESTS 7 15 0 1200
68772514 naveen19991124 B Jan. 14, 2020, 12:23 p.m. OK GNU C++14 TESTS 7 15 0 1200
68451564 srivastavadivyesh4 B Jan. 9, 2020, 2:32 p.m. OK GNU C++14 TESTS 7 15 0 1200
68063194 PARTH_4399 B Jan. 2, 2020, 5:58 a.m. OK GNU C++14 TESTS 7 15 0 1200
68047959 puru21 B Jan. 1, 2020, 5:21 p.m. OK GNU C++14 TESTS 7 15 0 1200
68047754 Pallove B Jan. 1, 2020, 5:15 p.m. OK GNU C++14 TESTS 7 15 0 1200
67120476 KhaledFarhat B Dec. 17, 2019, 6:19 p.m. OK GNU C++14 TESTS 7 15 0 1200
68148748 prakhar_111 B Jan. 4, 2020, 5:57 a.m. OK GNU C++17 TESTS 7 15 0 1200
68150142 L_lawliet27 B Jan. 4, 2020, 6:33 a.m. OK GNU C++17 TESTS 7 15 0 1200
68322960 Ethos B Jan. 6, 2020, 3:41 p.m. OK GNU C++17 TESTS 7 15 0 1200
68331069 MAC_19 B Jan. 6, 2020, 6:49 p.m. OK GNU C++17 TESTS 7 15 0 1200
68571475 penge B Jan. 11, 2020, 2:34 a.m. OK GNU C++17 TESTS 7 15 0 1200
68653261 9957 B Jan. 12, 2020, 11:26 a.m. OK GNU C++17 TESTS 7 15 0 1200
68958345 Adeeb005 B Jan. 16, 2020, 9:46 p.m. OK GNU C++17 TESTS 7 15 0 1200
69530742 vjudge1 B Jan. 25, 2020, 5 p.m. OK GNU C++17 TESTS 7 15 0 1200
69639196 k0ndr B Jan. 27, 2020, 7:57 p.m. OK GNU C++17 TESTS 7 15 0 1200
69849328 manovik18 B Jan. 30, 2020, 3:10 p.m. OK GNU C++17 TESTS 7 15 0 1200
44935605 vector9x B Oct. 27, 2018, 5:08 a.m. OK Go TESTS 7 46 0 1200
46746284 davidguandev B Dec. 8, 2018, 6:57 a.m. OK Go TESTS 7 61 0 1200
45422672 EdKaval B Nov. 7, 2018, 6:23 p.m. OK Go TESTS 7 62 0 1200
44297271 peter_jerry_ye B Oct. 14, 2018, 10:24 a.m. OK Haskell TESTS 7 15 0 1200
44300990 Haar B Oct. 14, 2018, 10:41 a.m. OK Haskell TESTS 7 31 8396800 1200
67247661 ashanksingh1997 B Dec. 19, 2019, 5:48 p.m. OK Java 11 TESTS 7 233 0 1200
44354894 vikashkumarbissu d_Mohanty ashwin9686 B Oct. 15, 2018, 11:59 a.m. OK Java 8 TESTS 7 93 0 1200
44299793 Geralt_Of_Rivia B Oct. 14, 2018, 10:35 a.m. OK Java 8 TESTS 7 93 0 1200
44297906 xodiac B Oct. 14, 2018, 10:27 a.m. OK Java 8 TESTS 7 93 0 1200
44950821 Faizan B Oct. 27, 2018, 12:01 p.m. OK Java 8 TESTS 7 108 0 1200
44483186 chandan5284 B Oct. 18, 2018, 11:20 a.m. OK Java 8 TESTS 7 108 0 1200
44361954 cis_pie B Oct. 15, 2018, 2:58 p.m. OK Java 8 TESTS 7 108 0 1200
44327154 sooraj10 B Oct. 14, 2018, 4:33 p.m. OK Java 8 TESTS 7 108 0 1200
44300747 Digwener B Oct. 14, 2018, 10:40 a.m. OK Java 8 TESTS 7 108 0 1200
44299930 darshankdarji B Oct. 14, 2018, 10:36 a.m. OK Java 8 TESTS 7 108 0 1200
44299652 programbhavan B Oct. 14, 2018, 10:34 a.m. OK Java 8 TESTS 7 108 0 1200
45320299 dimoff66 B Nov. 5, 2018, 10:14 a.m. OK JavaScript TESTS 7 31 1228800 1200
48776513 SergeySh B Jan. 23, 2019, 4:26 a.m. OK JavaScript TESTS 7 31 1331200 1200
59571119 gRaphael B Aug. 27, 2019, 12:37 p.m. OK Kotlin TESTS 7 109 0 1200
44294494 shaviava B Oct. 14, 2018, 10:14 a.m. OK Kotlin TESTS 7 124 0 1200
44578212 SergeyPat B Oct. 20, 2018, 7:42 a.m. OK Mono C# TESTS 7 46 0 1200
44298037 vivek17geek B Oct. 14, 2018, 10:27 a.m. OK Mono C# TESTS 7 46 0 1200
44301597 Roverandom B Oct. 14, 2018, 10:44 a.m. OK Mono C# TESTS 7 46 0 1200
44576600 mayumi B Oct. 20, 2018, 7:21 a.m. OK Mono C# TESTS 7 46 0 1200
44309473 mircea85 B Oct. 14, 2018, 11:29 a.m. OK Mono C# TESTS 7 46 102400 1200
68858137 mban259 B Jan. 15, 2020, 11:14 a.m. OK Mono C# TESTS 7 46 102400 1200
44298819 Tatonka B Oct. 14, 2018, 10:31 a.m. OK Mono C# TESTS 7 46 102400 1200
44302471 tattosha_aptan B Oct. 14, 2018, 10:49 a.m. OK Mono C# TESTS 7 46 1433600 1200
44405603 azukun B Oct. 16, 2018, 2:42 p.m. OK Mono C# TESTS 7 46 1843200 1200
44323167 antony-10 B Oct. 14, 2018, 2:55 p.m. OK Mono C# TESTS 7 46 3686400 1200
51071789 sdibt5 B March 9, 2019, 7:57 a.m. OK MS C++ TESTS 7 15 0 1200
51070733 sdibt5 B March 9, 2019, 7:33 a.m. OK MS C++ TESTS 7 15 0 1200
50430469 vjudge1 B Feb. 24, 2019, 1:46 p.m. OK MS C++ TESTS 7 15 0 1200
53094076 vjudge5 B April 21, 2019, 12:38 p.m. OK MS C++ TESTS 7 15 0 1200
54371130 vjudge5 B May 19, 2019, 6:36 a.m. OK MS C++ TESTS 7 15 0 1200
58159478 vjudge2 B Aug. 2, 2019, 6:55 a.m. OK MS C++ TESTS 7 15 0 1200
62092618 vjudge2 B Oct. 8, 2019, 6:25 a.m. OK MS C++ TESTS 7 15 0 1200
51073868 sdibt3 B March 9, 2019, 8:43 a.m. OK MS C++ TESTS 7 15 0 1200
63518366 vjudge1 B Oct. 27, 2019, 2:17 a.m. OK MS C++ TESTS 7 15 0 1200
52012512 vjudge1 B March 30, 2019, 9:12 a.m. OK MS C++ TESTS 7 15 0 1200
49170045 Whirligig B Jan. 29, 2019, 5:51 p.m. OK MS C++ 2017 TESTS 7 15 0 1200
58156634 vjudge3 B Aug. 2, 2019, 5:55 a.m. OK MS C++ 2017 TESTS 7 30 0 1200
62927098 Still_Theory B Oct. 19, 2019, 11:39 a.m. OK MS C++ 2017 TESTS 7 30 0 1200
58160834 vjudge2 B Aug. 2, 2019, 7:21 a.m. OK MS C++ 2017 TESTS 7 31 0 1200
65673520 AleksanderBalobanov B Nov. 24, 2019, 4:59 p.m. OK MS C++ 2017 TESTS 7 31 0 1200
64251118 shio B Nov. 4, 2019, 2:57 p.m. OK MS C++ 2017 TESTS 7 31 0 1200
44298844 Arcadii B Oct. 14, 2018, 10:31 a.m. OK PascalABC.NET TESTS 7 62 307200 1200
44303550 Vassek B Oct. 14, 2018, 10:55 a.m. OK PascalABC.NET TESTS 7 62 409600 1200
44298684 l-_-l B Oct. 14, 2018, 10:30 a.m. OK PascalABC.NET TESTS 7 62 409600 1200
51355247 mm944 B March 16, 2019, 3:31 a.m. OK PascalABC.NET TESTS 7 326 0 1200
44318029 rsFalse B Oct. 14, 2018, 1:24 p.m. OK Perl TESTS 7 31 0 1200
44305131 rsFalse B Oct. 14, 2018, 11:04 a.m. OK Perl TESTS 7 62 0 1200
49784563 RemiliaScarlet B Feb. 11, 2019, 7:07 p.m. OK Perl TESTS 7 187 0 1200
44298603 c1729 B Oct. 14, 2018, 10:30 a.m. OK PyPy 2 TESTS 7 139 102400 1200
44295460 phantomhive B Oct. 14, 2018, 10:17 a.m. OK PyPy 2 TESTS 7 140 0 1200
44993489 c1729 B Oct. 28, 2018, 2:08 p.m. OK PyPy 2 TESTS 7 140 102400 1200
44303074 SerChirag B Oct. 14, 2018, 10:52 a.m. OK PyPy 2 TESTS 7 140 409600 1200
44298503 abhigyank B Oct. 14, 2018, 10:29 a.m. OK PyPy 2 TESTS 7 140 1024000 1200
44302609 PBatch B Oct. 14, 2018, 10:50 a.m. OK PyPy 2 TESTS 7 155 204800 1200
44306074 bertrandovide B Oct. 14, 2018, 11:09 a.m. OK PyPy 2 TESTS 7 155 204800 1200
44301944 morgo B Oct. 14, 2018, 10:46 a.m. OK PyPy 2 TESTS 7 156 921600 1200
44324187 alankrit_singh_1 B Oct. 14, 2018, 3:18 p.m. OK PyPy 2 TESTS 7 156 921600 1200
44298996 Mukundan314 B Oct. 14, 2018, 10:31 a.m. OK PyPy 2 TESTS 7 171 0 1200
44331018 FahimSifnatul B Oct. 14, 2018, 6:23 p.m. OK PyPy 3 TESTS 7 124 102400 1200
44303772 Mr.Inconsistent B Oct. 14, 2018, 10:56 a.m. OK PyPy 3 TESTS 7 140 204800 1200
45767390 sonya123 B Nov. 15, 2018, 12:50 p.m. OK PyPy 3 TESTS 7 155 716800 1200
44423902 neverwin B Oct. 17, 2018, 2:25 a.m. OK PyPy 3 TESTS 7 155 921600 1200
45251377 bergus B Nov. 3, 2018, 4:43 p.m. OK PyPy 3 TESTS 7 155 1740800 1200
44551933 johnzeng B Oct. 19, 2018, 3:37 p.m. OK PyPy 3 TESTS 7 156 1228800 1200
44302086 Elluran B Oct. 14, 2018, 10:47 a.m. OK PyPy 3 TESTS 7 156 1228800 1200
44764240 SoSooding B Oct. 24, 2018, 8:53 a.m. OK PyPy 3 TESTS 7 171 921600 1200
49865178 III_Wolverine_III B Feb. 13, 2019, 11:43 a.m. OK PyPy 3 TESTS 7 171 921600 1200
44469618 nikeshthapa255 B Oct. 18, 2018, 5:30 a.m. OK PyPy 3 TESTS 7 171 921600 1200
46263677 WNG B Nov. 26, 2018, 10:55 p.m. OK Python 2 TESTS 7 155 0 1200
44337377 wangkan2001 B Oct. 14, 2018, 11:11 p.m. OK Python 2 TESTS 7 155 0 1200
44302094 GabrielN B Oct. 14, 2018, 10:47 a.m. OK Python 2 TESTS 7 155 0 1200
44298263 HeypaBHoBeceH B Oct. 14, 2018, 10:28 a.m. OK Python 2 TESTS 7 155 0 1200
44296006 grebnesieh B Oct. 14, 2018, 10:19 a.m. OK Python 2 TESTS 7 170 0 1200
45344652 EoinDavey B Nov. 6, 2018, 1:34 a.m. OK Python 2 TESTS 7 171 0 1200
55614625 kaif_7 B June 16, 2019, 8:08 a.m. OK Python 2 TESTS 7 171 0 1200
54329617 soumyasarkar1998 B May 18, 2019, 5:06 a.m. OK Python 2 TESTS 7 171 0 1200
47884304 kingmoshe B Jan. 3, 2019, 8:38 p.m. OK Python 2 TESTS 7 171 0 1200
44540300 UltimateWeapon B Oct. 19, 2018, 11:09 a.m. OK Python 2 TESTS 7 171 0 1200
60478292 ziddi B Sept. 13, 2019, 9:16 a.m. OK Python 3 TESTS 7 108 0 1200
55840415 petushny B June 20, 2019, 5:41 p.m. OK Python 3 TESTS 7 108 0 1200
54054918 lIn_nIl B May 13, 2019, 7:30 a.m. OK Python 3 TESTS 7 108 0 1200
50353692 ravi_joe B Feb. 23, 2019, 9:46 a.m. OK Python 3 TESTS 7 108 0 1200
44449128 nani_7 B Oct. 17, 2018, 3:07 p.m. OK Python 3 TESTS 7 108 0 1200
44358714 aarsh01 B Oct. 15, 2018, 1:38 p.m. OK Python 3 TESTS 7 108 0 1200
44326694 GDUT-hzy B Oct. 14, 2018, 4:22 p.m. OK Python 3 TESTS 7 108 0 1200
44303886 rajat_2548 B Oct. 14, 2018, 10:57 a.m. OK Python 3 TESTS 7 108 0 1200
44406796 drknvv B Oct. 16, 2018, 3:10 p.m. OK Python 3 TESTS 7 108 102400 1200
44330876 MichaelSerrato B Oct. 14, 2018, 6:20 p.m. OK Python 3 TESTS 7 108 102400 1200
44326577 cielavenir B Oct. 14, 2018, 4:19 p.m. OK Ruby TESTS 7 46 0 1200
46040773 annoreen B Nov. 21, 2018, 7:34 p.m. OK Ruby TESTS 7 61 0 1200
44297975 sh19910711 B Oct. 14, 2018, 10:27 a.m. OK Ruby TESTS 7 62 0 1200
44300921 0x1bd2 B Oct. 14, 2018, 10:41 a.m. OK Ruby TESTS 7 93 0 1200
44474231 0w1 B Oct. 18, 2018, 8 a.m. OK Ruby TESTS 7 202 0 1200
44295139 yakamoto B Oct. 14, 2018, 10:16 a.m. OK Scala TESTS 7 405 0 1200

remove filters

Back to search problems