Codeforces Round 172 (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
280 Codeforces Round 172 (Div. 1) FINISHED False 7200 374509787 March 10, 2013, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4793 ) B Maximum Xor Secondary PROGRAMMING data structures implementation two pointers 2000

B"Bike loves looking for the second maximum element in the sequence. The second maximum element in the sequence of distinct numbers x1, xe2 x80 x89x2, xe2 x80 x89..., xe2 x80 x89xk (k xe2 x80 x89> xe2 x80 x891) is such maximum element xj, that the following inequality holds: . The lucky number of the sequence of distinct positive integers x1, xe2 x80 x89x2, xe2 x80 x89..., xe2 x80 x89xk (k xe2 x80 x89> xe2 x80 x891) is the number that is equal to the bitwise excluding OR of the maximum element of the sequence and the second maximum element of the sequence. You've got a sequence of distinct positive integers s1, xe2 x80 x89s2, xe2 x80 x89..., xe2 x80 x89sn (n xe2 x80 x89> xe2 x80 x891). Let's denote sequence sl, xe2 x80 x89sl xe2 x80 x89+ xe2 x80 x891, xe2 x80 x89..., xe2 x80 x89sr as s[l..r] (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89l xe2 x80 x89< xe2 x80 x89r xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n). Your task is to find the maximum number among all lucky numbers of sequences s[l..r]. Note that as all numbers in sequence s are distinct, all the given definitions make sence. The first line contains integer n (1 xe2 x80 x89< xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). The second line contains n distinct integers s1, xe2 x80 x89s2, xe2 x80 x89..., xe2 x80 x89sn (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89si xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109). Print a single integer -- the maximum lucky number among all lucky numbers of sequences s[l..r]. For the first sample you can choose s[4..5] xe2 x80 x89= xe2 x80 x89{4, xe2 x80 x893} and its lucky number is (4 xor 3) xe2 x80 x89= xe2 x80 x897. You can also choose s[1..2]. For the second sample you must choose s[2..5] xe2 x80 x89= xe2 x80 x89{8, xe2 x80 x893, xe2 x80 x895, xe2 x80 x897}."...

Tutorials

T

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
3285192 Gassa B March 10, 2013, 6:48 p.m. OK D TESTS 56 156 2969600 2000
3279043 Gassa B March 10, 2013, 4:17 p.m. OK D TESTS 56 171 3072000 2000
3290851 Misha100896 B March 11, 2013, 3:29 p.m. OK Delphi TESTS 56 31 409600 2000
3280459 Shaykhutdinov-T-I B March 10, 2013, 4:34 p.m. OK Delphi TESTS 56 31 1228800 2000
3279085 amirrr B March 10, 2013, 4:17 p.m. OK Delphi TESTS 56 31 12083200 2000
3292052 ViruZ B March 11, 2013, 8:33 p.m. OK Delphi TESTS 56 46 1638400 2000
3288455 AleksanderBalobanov B March 11, 2013, 8:03 a.m. OK Delphi TESTS 56 46 3686400 2000
3288449 AleksanderBalobanov B March 11, 2013, 8:01 a.m. OK Delphi TESTS 56 46 6041600 2000
3284741 equi B March 10, 2013, 6:30 p.m. OK Delphi TESTS 56 46 9420800 2000
3279646 IgorL B March 10, 2013, 4:24 p.m. OK Delphi TESTS 56 625 13312000 2000
3281584 Furko B March 10, 2013, 4:50 p.m. OK Delphi TESTS 56 1250 72192000 2000
7374192 artem1416 B Aug. 8, 2014, 7:26 a.m. OK FPC TESTS 56 31 819200 2000
7252291 imhereonlyforcookies B July 26, 2014, 6:44 p.m. OK FPC TESTS 56 31 819200 2000
3849958 Nik_Storm_2010 B June 9, 2013, 9:04 a.m. OK FPC TESTS 56 46 409600 2000
3318222 Rosetta B March 14, 2013, 7:55 p.m. OK FPC TESTS 56 46 409600 2000
3291919 Petrushenko B March 11, 2013, 7:43 p.m. OK FPC TESTS 56 46 512000 2000
3412030 Oryshych B March 27, 2013, 1:21 p.m. OK FPC TESTS 56 46 819200 2000
3315470 BrightDays B March 14, 2013, 9:50 a.m. OK FPC TESTS 56 46 819200 2000
3293393 yanush B March 12, 2013, 8:01 a.m. OK FPC TESTS 56 46 819200 2000
3293362 Ferathorn B March 12, 2013, 7:51 a.m. OK FPC TESTS 56 46 819200 2000
3293359 kuskova B March 12, 2013, 7:50 a.m. OK FPC TESTS 56 46 819200 2000
3299138 pnging B March 13, 2013, 2:49 p.m. OK GNU C TESTS 56 46 409600 2000
12431207 biltharesatyendra B Aug. 10, 2015, 2:22 a.m. OK GNU C TESTS 56 46 819200 2000
3356207 pedja B March 19, 2013, 11:25 a.m. OK GNU C TESTS 56 46 819200 2000
3280407 ali_fiujnomali B March 10, 2013, 4:33 p.m. OK GNU C TESTS 56 46 12595200 2000
27334618 ShinriiTin B May 25, 2017, 11:09 a.m. OK GNU C++ TESTS 56 15 614400 2000
4033376 xy666 B July 7, 2013, 6:10 a.m. OK GNU C++ TESTS 56 15 819200 2000
3280238 bakabakashyoshyo B March 10, 2013, 4:31 p.m. OK GNU C++ TESTS 56 15 7987200 2000
24641255 yah01 B Feb. 14, 2017, 3:44 a.m. OK GNU C++ TESTS 56 30 3686400 2000
5332805 FancyCoder B Dec. 2, 2013, 11:57 a.m. OK GNU C++ TESTS 56 30 7987200 2000
14089979 130705009 B Nov. 5, 2015, 1:38 p.m. OK GNU C++ TESTS 56 31 204800 2000
15623653 jerrywanglaoji B Jan. 28, 2016, 6:16 a.m. OK GNU C++ TESTS 56 31 409600 2000
15640327 fywaway B Jan. 29, 2016, 6:25 a.m. OK GNU C++ TESTS 56 31 409600 2000
15626203 vjudge4 B Jan. 28, 2016, 9:34 a.m. OK GNU C++ TESTS 56 31 409600 2000
15623826 vjudge3 B Jan. 28, 2016, 6:34 a.m. OK GNU C++ TESTS 56 31 409600 2000
3278935 htc550605125 B March 10, 2013, 4:15 p.m. OK GNU C++0x TESTS 56 15 409600 2000
6438321 arthur.nascimento B April 22, 2014, 6:01 a.m. OK GNU C++0x TESTS 56 31 409600 2000
3318531 MinakoKojima B March 14, 2013, 11:17 p.m. OK GNU C++0x TESTS 56 31 512000 2000
3384311 savinov B March 23, 2013, 7:35 a.m. OK GNU C++0x TESTS 56 31 1126400 2000
6996646 kllp B July 2, 2014, 10:19 a.m. OK GNU C++0x TESTS 56 31 1433600 2000
6836649 ArmanK B June 8, 2014, 11:26 a.m. OK GNU C++0x TESTS 56 31 1536000 2000
6564308 Erfan.aa B May 6, 2014, 7:45 p.m. OK GNU C++0x TESTS 56 31 1945600 2000
6162090 adelnobel B March 27, 2014, 2:20 p.m. OK GNU C++0x TESTS 56 31 2150400 2000
3282377 BryantMark B March 10, 2013, 5:02 p.m. OK GNU C++0x TESTS 56 31 2252800 2000
9737571 Nodir.Daminov B Feb. 6, 2015, 3:07 p.m. OK GNU C++0x TESTS 56 31 8601600 2000
58671047 rainboy B Aug. 12, 2019, 2:25 p.m. OK GNU C11 TESTS 56 46 819200 2000
19550847 ZWY B Aug. 1, 2016, 5:28 a.m. OK GNU C++11 TESTS 56 30 819200 2000
32037778 TadijaSebez B Nov. 3, 2017, 9:43 p.m. OK GNU C++11 TESTS 56 31 204800 2000
60754313 DennyQi B Sept. 18, 2019, 8:03 a.m. OK GNU C++11 TESTS 56 31 204800 2000
63621737 Wang_ml B Oct. 27, 2019, 11:46 p.m. OK GNU C++11 TESTS 56 31 409600 2000
63291867 Dean_zhang B Oct. 24, 2019, 11:58 a.m. OK GNU C++11 TESTS 56 31 409600 2000
63279806 Haworthia B Oct. 24, 2019, 8:18 a.m. OK GNU C++11 TESTS 56 31 409600 2000
58066235 luogu_bot5 B July 31, 2019, 9 a.m. OK GNU C++11 TESTS 56 31 409600 2000
40933668 pipialvin B July 30, 2018, 2:48 a.m. OK GNU C++11 TESTS 56 31 409600 2000
27328811 Deng2X B May 25, 2017, 3:41 a.m. OK GNU C++11 TESTS 56 31 409600 2000
68635698 shengzihang B Jan. 12, 2020, 5:42 a.m. OK GNU C++11 TESTS 56 31 409600 2000
26880825 pimukthee B May 5, 2017, 12:51 p.m. OK GNU C++14 TESTS 56 31 614400 2000
29373702 nevermore B Aug. 12, 2017, 9:20 a.m. OK GNU C++14 TESTS 56 31 2457600 2000
55331010 Ada.Grad.Shil B June 9, 2019, 10:59 a.m. OK GNU C++14 TESTS 56 46 409600 2000
46876456 monk_z B Dec. 10, 2018, 6:15 p.m. OK GNU C++14 TESTS 56 46 409600 2000
31006780 xxxcxxx B Oct. 5, 2017, 3:49 a.m. OK GNU C++14 TESTS 56 46 409600 2000
27786448 WhitePaper B June 15, 2017, 5:12 a.m. OK GNU C++14 TESTS 56 46 409600 2000
21732458 Xin-Jie B Oct. 24, 2016, 3:23 a.m. OK GNU C++14 TESTS 56 46 409600 2000
55668670 Ada.Grad.Shil B June 17, 2019, 6:06 a.m. OK GNU C++14 TESTS 56 46 409600 2000
40233118 dorostmishe B July 12, 2018, 1:11 p.m. OK GNU C++14 TESTS 56 46 512000 2000
67166090 Mirbek_aka B Dec. 18, 2019, 3:36 p.m. OK GNU C++14 TESTS 56 46 614400 2000
58182839 TianSunXing B Aug. 2, 2019, 3:54 p.m. OK GNU C++17 TESTS 56 46 409600 2000
58080896 vjudge2 B July 31, 2019, 1:52 p.m. OK GNU C++17 TESTS 56 46 409600 2000
57717179 venkatesh_saki B July 25, 2019, 3:16 a.m. OK GNU C++17 TESTS 56 46 409600 2000
57638252 vjudge2 B July 24, 2019, 11:40 a.m. OK GNU C++17 TESTS 56 46 614400 2000
67278920 tehillah B Dec. 20, 2019, 12:30 p.m. OK GNU C++17 TESTS 56 46 614400 2000
62745999 Vladikus004 B Oct. 16, 2019, 9:40 p.m. OK GNU C++17 TESTS 56 46 614400 2000
58199553 TianPingXing B Aug. 3, 2019, 3:12 a.m. OK GNU C++17 TESTS 56 46 819200 2000
58199469 TianSunXing B Aug. 3, 2019, 3:08 a.m. OK GNU C++17 TESTS 56 46 819200 2000
69285739 Alchemist0 B Jan. 22, 2020, 8:05 a.m. OK GNU C++17 TESTS 56 46 819200 2000
58268057 TianJianXing B Aug. 4, 2019, 3:32 p.m. OK GNU C++17 TESTS 56 46 819200 2000
66609710 KulikAlex B Dec. 10, 2019, 8:36 p.m. OK Java 11 TESTS 56 264 0 2000
7443575 vjudge5 B Aug. 13, 2014, 3:05 p.m. OK Java 6 TESTS 56 109 0 2000
3288146 emo B March 11, 2013, 6:56 a.m. OK Java 6 TESTS 56 109 0 2000
3784101 vjudge2 B May 27, 2013, 1:06 p.m. OK Java 6 TESTS 56 125 2457600 2000
3277900 piotr.kukla B March 10, 2013, 4:04 p.m. OK Java 6 TESTS 56 140 0 2000
4086757 mkirsche B July 17, 2013, 12:32 p.m. OK Java 6 TESTS 56 140 102400 2000
3317357 jmoreira B March 14, 2013, 4:44 p.m. OK Java 6 TESTS 56 156 0 2000
3986362 Sammarize B June 28, 2013, 7:10 p.m. OK Java 6 TESTS 56 156 2355200 2000
3280665 hs484 B March 10, 2013, 4:37 p.m. OK Java 6 TESTS 56 156 2457600 2000
3318502 Mostafa.Ali B March 14, 2013, 10:45 p.m. OK Java 6 TESTS 56 171 0 2000
3276888 uwi B March 10, 2013, 3:53 p.m. OK Java 6 TESTS 56 203 0 2000
8773752 GhpS B Nov. 21, 2014, 12:24 p.m. OK Java 7 TESTS 56 108 0 2000
6639262 HidenoriS B May 16, 2014, 10:43 p.m. OK Java 7 TESTS 56 109 0 2000
3277222 Egor B March 10, 2013, 3:57 p.m. OK Java 7 TESTS 56 109 0 2000
7443567 skyrim B Aug. 13, 2014, 3:04 p.m. OK Java 7 TESTS 56 124 0 2000
3277007 ilyakor B March 10, 2013, 3:55 p.m. OK Java 7 TESTS 56 125 0 2000
3277050 Jokser B March 10, 2013, 3:55 p.m. OK Java 7 TESTS 56 125 102400 2000
3317407 mashinist B March 14, 2013, 4:52 p.m. OK Java 7 TESTS 56 140 0 2000
3281651 antonkov B March 10, 2013, 4:51 p.m. OK Java 7 TESTS 56 140 0 2000
3279891 niyaznigmatul B March 10, 2013, 4:27 p.m. OK Java 7 TESTS 56 140 0 2000
3277683 yaro B March 10, 2013, 4:02 p.m. OK Java 7 TESTS 56 140 0 2000
51592453 jenish9599 B March 20, 2019, 7:29 p.m. OK Java 8 TESTS 56 139 0 2000
45177129 hongquanntct B Nov. 1, 2018, 3:17 p.m. OK Java 8 TESTS 56 139 0 2000
16442716 AStepanov B March 1, 2016, 2:13 p.m. OK Java 8 TESTS 56 140 0 2000
41098557 prabhat236218 B Aug. 1, 2018, 10:02 p.m. OK Java 8 TESTS 56 140 38297600 2000
66997767 pulkit1411 B Dec. 16, 2019, 3:29 a.m. OK Java 8 TESTS 56 155 0 2000
39740140 pc9795 B June 28, 2018, 10:42 a.m. OK Java 8 TESTS 56 155 0 2000
11107985 dhrumil140396 B May 15, 2015, 2:05 p.m. OK Java 8 TESTS 56 171 0 2000
57249482 Hamza_Hassan B July 17, 2019, 9:34 p.m. OK Java 8 TESTS 56 171 0 2000
41213357 parth_15 B Aug. 4, 2018, 11:50 a.m. OK Java 8 TESTS 56 171 0 2000
39739909 pc9795 B June 28, 2018, 10:33 a.m. OK Java 8 TESTS 56 171 0 2000
3358147 Awa149 B March 19, 2013, 5:29 p.m. OK Mono C# TESTS 56 78 13926400 2000
3298585 Varsag B March 13, 2013, 12:41 p.m. OK Mono C# TESTS 56 78 14336000 2000
22898156 og.kostya B Dec. 12, 2016, 5:36 a.m. OK MS C# TESTS 56 62 1740800 2000
51466804 hengheng B March 19, 2019, 2:29 a.m. OK MS C++ TESTS 56 31 1228800 2000
14098852 TillEnd B Nov. 6, 2015, 3:40 a.m. OK MS C++ TESTS 56 31 1228800 2000
3684670 alexander-nsk94 B May 6, 2013, 5:44 a.m. OK MS C++ TESTS 56 46 409600 2000
3404397 RiKang B March 25, 2013, 1:25 p.m. OK MS C++ TESTS 56 46 409600 2000
3361483 Dmx B March 20, 2013, 3:48 p.m. OK MS C++ TESTS 56 46 409600 2000
3291721 LovelyPenguin B March 11, 2013, 6:39 p.m. OK MS C++ TESTS 56 46 409600 2000
51467695 vjudge3 B March 19, 2019, 3:26 a.m. OK MS C++ TESTS 56 46 409600 2000
3284645 agul B March 10, 2013, 6:28 p.m. OK MS C++ TESTS 56 46 409600 2000
3290012 harhrayr B March 11, 2013, 12:53 p.m. OK MS C++ TESTS 56 46 409600 2000
45910577 vjudge4 B Nov. 18, 2018, 11:07 a.m. OK MS C++ TESTS 56 46 409600 2000
54474812 zhuiyi B May 22, 2019, 7:48 a.m. OK MS C++ 2017 TESTS 56 78 43315200 2000
58183211 TianZuiXing B Aug. 2, 2019, 4:03 p.m. OK MS C++ 2017 TESTS 56 109 716800 2000
60511458 CtrlAlt B Sept. 14, 2019, 3:19 a.m. OK MS C++ 2017 TESTS 56 109 1638400 2000
3413774 jhcmonroy B March 28, 2013, 12:56 a.m. OK Perl TESTS 56 328 16179200 2000
15915048 not_bot_but_POT B Feb. 9, 2016, 1:58 p.m. OK Python 2 TESTS 56 202 5632000 2000
35857174 ______u______ B March 2, 2018, 8:34 p.m. OK Python 2 TESTS 56 249 10240000 2000
35857072 ______n______ B March 2, 2018, 8:33 p.m. OK Python 2 TESTS 56 249 10240000 2000
35856687 _____i_____ B March 2, 2018, 8:26 p.m. OK Python 2 TESTS 56 249 10240000 2000
35856313 _____k_____ B March 2, 2018, 8:17 p.m. OK Python 2 TESTS 56 249 10240000 2000
35847653 ______k______ B March 2, 2018, 4:46 p.m. OK Python 2 TESTS 56 249 10240000 2000
35847652 ______h______ B March 2, 2018, 4:46 p.m. OK Python 2 TESTS 56 249 10240000 2000
35847473 ______i______ B March 2, 2018, 4:45 p.m. OK Python 2 TESTS 56 249 10240000 2000
35842852 ______M______ B March 2, 2018, 3 p.m. OK Python 2 TESTS 56 249 10240000 2000
3408601 codedr B March 26, 2013, 2:20 p.m. OK Python 2 TESTS 56 250 5529600 2000
42124433 Mk_Python_v1 B Aug. 26, 2018, 2:16 p.m. OK Python 3 TESTS 56 265 8396800 2000
57605334 cskanani B July 23, 2019, 5:38 p.m. OK Python 3 TESTS 56 280 8192000 2000
55239014 shanu_im B June 7, 2019, 9:52 a.m. OK Python 3 TESTS 56 312 8396800 2000
54017358 _nathan_drake_ B May 12, 2019, 7:36 a.m. OK Python 3 TESTS 56 373 8396800 2000
42228631 anny11 B Aug. 29, 2018, 5:08 a.m. OK Python 3 TESTS 56 389 8089600 2000
3318527 superstar B March 14, 2013, 11:09 p.m. OK Scala TESTS 56 937 204800 2000

remove filters

Back to search problems