Codeforces Round 112 (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
165 Codeforces Round 112 (Div. 2) FINISHED False 7200 399911399 March 16, 2012, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6960 ) E Compatible Numbers PROGRAMMING bitmasks brute force dfs and similar dp 2100

B'Two integers x and y are compatible, if the result of their bitwise "AND" equals zero, that is, a & b xe2 x80 x89= xe2 x80 x890. For example, numbers 90 (10110102) and 36 (1001002) are compatible, as 10110102 & 1001002 xe2 x80 x89= xe2 x80 x8902, and numbers 3 (112) and 6 (1102) are not compatible, as 112 & 1102 xe2 x80 x89= xe2 x80 x89102. You are given an array of integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an. Your task is to find the following for each array element: is this element compatible with some other element from the given array? If the answer to this question is positive, then you also should find any suitable element. The first line contains an integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106) -- the number of elements in the given array. The second line contains n space-separated integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x894 xc2 xb7106) -- the elements of the given array. The numbers in the array can coincide. Print n integers ansi. If ai isn 't compatible with any other element of the given array a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an, then ansi should be equal to -1. Otherwise ansi is any such number, that ai & ansi xe2 x80 x89= xe2 x80 x890, and also ansi occurs in the array a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an.'...

Tutorials

Codeforces Round #112 (Div. 2) Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
27541559 cpy E June 3, 2017, 10:46 a.m. OK D TESTS 87 2964 31232000 2100
2224332 KaiZeR E Sept. 20, 2012, 4:53 p.m. OK Delphi TESTS 87 796 53555200 2100
1810407 KaiZeR E June 19, 2012, 2:40 p.m. OK Delphi TESTS 87 1170 57651200 2100
5997906 Nik_Storm_2010 E March 11, 2014, 4:43 p.m. OK Delphi TESTS 87 1466 33689600 2100
4050201 Misha100896 E July 11, 2013, 10:44 a.m. OK Delphi TESTS 87 2343 24064000 2100
3203935 AleksanderBalobanov E Feb. 27, 2013, 6:49 p.m. OK Delphi TESTS 87 2593 48128000 2100
2224138 25122008 E Sept. 20, 2012, 3:53 p.m. OK FPC TESTS 87 937 38707200 2100
1970885 Chen_ChaoRui E Aug. 2, 2012, 12:43 p.m. OK FPC TESTS 87 980 22425600 2100
2104062 vilcheuski E Sept. 8, 2012, 11:24 a.m. OK FPC TESTS 87 1218 36249600 2100
1894722 gskhirtladze E July 12, 2012, 7:32 a.m. OK FPC TESTS 87 1580 95334400 2100
4430219 oshawott E Sept. 8, 2013, 2:40 a.m. OK FPC TESTS 87 1622 40140800 2100
4147067 AHTuTTuTyX E July 24, 2013, 12:02 p.m. OK FPC TESTS 87 1684 33792000 2100
2271059 Alex_2oo8 E Sept. 30, 2012, 12:29 p.m. OK FPC TESTS 87 2281 24064000 2100
24899302 Zeron E Feb. 22, 2017, 5:48 p.m. OK FPC TESTS 87 2524 68812800 2100
24823392 Zeron E Feb. 20, 2017, 1:56 p.m. OK FPC TESTS 87 3494 68812800 2100
4913312 longbiau E Oct. 27, 2013, 1:31 p.m. OK GNU C++ TESTS 87 499 20787200 2100
40500098 jangjie E July 18, 2018, 5:35 a.m. OK GNU C++ TESTS 87 560 23859200 2100
4931775 doraemongrapes E Oct. 30, 2013, 3:50 a.m. OK GNU C++ TESTS 87 577 40038400 2100
2106721 trunghieu11 E Sept. 9, 2012, 3:31 p.m. OK GNU C++ TESTS 87 610 25497600 2100
1992629 aaa_bbb_ccc E Aug. 8, 2012, 9:49 a.m. OK GNU C++ TESTS 87 660 35020800 2100
5408973 masaoh E Dec. 11, 2013, 11:42 a.m. OK GNU C++ TESTS 87 686 20787200 2100
2269199 vjudge3 E Sept. 29, 2012, 1:27 p.m. OK GNU C++ TESTS 87 765 37990400 2100
34917157 vjudge1 E Feb. 4, 2018, 7:52 a.m. OK GNU C++ TESTS 87 778 22732800 2100
15305445 BakaNiner E Jan. 11, 2016, 11:34 p.m. OK GNU C++ TESTS 87 780 20582400 2100
15296110 vjudge5 E Jan. 11, 2016, 3:57 p.m. OK GNU C++ TESTS 87 780 20582400 2100
4931763 Lien E Oct. 30, 2013, 3:46 a.m. OK GNU C++0x TESTS 87 733 20787200 2100
5856674 sh19910711 E Jan. 31, 2014, 1:16 p.m. OK GNU C++0x TESTS 87 872 33075200 2100
1967690 savinov E Aug. 1, 2012, 9:22 a.m. OK GNU C++0x TESTS 87 910 22220800 2100
1967678 savinov E Aug. 1, 2012, 9:18 a.m. OK GNU C++0x TESTS 87 950 22220800 2100
5290962 marat.snowbear E Nov. 29, 2013, 3:12 a.m. OK GNU C++0x TESTS 87 1028 20787200 2100
6479620 i2ou E April 26, 2014, 2:54 p.m. OK GNU C++0x TESTS 87 1058 20787200 2100
6479909 mag20174301 E April 26, 2014, 3:56 p.m. OK GNU C++0x TESTS 87 1060 20787200 2100
8181795 zhangxipeng E Oct. 12, 2014, 9:30 a.m. OK GNU C++0x TESTS 87 1060 33587200 2100
6246933 2011330300713 E April 3, 2014, 3:56 a.m. OK GNU C++0x TESTS 87 1122 20787200 2100
3264220 EarlOfDitches E March 8, 2013, 4:06 a.m. OK GNU C++0x TESTS 87 1123 24064000 2100
44523923 Ithea_Myse_Valgulious E Oct. 18, 2018, 11:38 p.m. OK GNU C++11 TESTS 87 560 75673600 2100
44523917 Fuko_Ibuki E Oct. 18, 2018, 11:38 p.m. OK GNU C++11 TESTS 87 560 75673600 2100
44523905 vjudge3 E Oct. 18, 2018, 11:37 p.m. OK GNU C++11 TESTS 87 560 75673600 2100
38815845 diogo E June 1, 2018, 1:20 a.m. OK GNU C++11 TESTS 87 622 37171200 2100
50592080 Fan_of_IceLocke E Feb. 28, 2019, 8:01 a.m. OK GNU C++11 TESTS 87 654 20889600 2100
45311171 dream_maker E Nov. 5, 2018, 4:08 a.m. OK GNU C++11 TESTS 87 654 134451200 2100
63116428 luogu_bot2 E Oct. 22, 2019, 9:30 a.m. OK GNU C++11 TESTS 87 684 20787200 2100
62116802 wzlwzl E Oct. 8, 2019, 1:35 p.m. OK GNU C++11 TESTS 87 716 24473600 2100
45999634 luogu_bot4 E Nov. 20, 2018, 1:54 p.m. OK GNU C++11 TESTS 87 746 20787200 2100
64280260 luogu_bot1 E Nov. 5, 2019, 1:12 a.m. OK GNU C++11 TESTS 87 746 33587200 2100
45270944 1799342217 E Nov. 4, 2018, 8:29 a.m. OK GNU C++14 TESTS 87 684 20889600 2100
32088622 ZigZagK E Nov. 6, 2017, 7 a.m. OK GNU C++14 TESTS 87 746 20889600 2100
63039265 ShadowLight E Oct. 20, 2019, 11:05 p.m. OK GNU C++14 TESTS 87 998 20787200 2100
61442183 AJ47 E Sept. 28, 2019, 7:15 p.m. OK GNU C++14 TESTS 87 1028 20787200 2100
46715760 win11905 E Dec. 7, 2018, 11:05 a.m. OK GNU C++14 TESTS 87 1028 20787200 2100
51916194 The_Game_On E March 27, 2019, 10:03 p.m. OK GNU C++14 TESTS 87 1028 21094400 2100
59904986 phoenix28 E Sept. 2, 2019, 3 p.m. OK GNU C++14 TESTS 87 1028 23142400 2100
53801605 hossain.ruetcse E May 5, 2019, 7:13 p.m. OK GNU C++14 TESTS 87 1028 24780800 2100
61593485 uf2as410 E Oct. 1, 2019, 7:54 a.m. OK GNU C++14 TESTS 87 1028 33587200 2100
68701631 ascent E Jan. 13, 2020, 9:39 a.m. OK GNU C++14 TESTS 87 1028 33894400 2100
63039687 Aleks5d E Oct. 20, 2019, 11:28 p.m. OK GNU C++17 TESTS 87 436 20889600 2100
63039496 Aleks5d E Oct. 20, 2019, 11:17 p.m. OK GNU C++17 TESTS 87 466 20787200 2100
63039817 Aleks5d E Oct. 20, 2019, 11:35 p.m. OK GNU C++17 TESTS 87 468 20787200 2100
63039678 Aleks5d E Oct. 20, 2019, 11:27 p.m. OK GNU C++17 TESTS 87 496 20787200 2100
63039829 Aleks5d E Oct. 20, 2019, 11:36 p.m. OK GNU C++17 TESTS 87 498 20787200 2100
63039564 Aleks5d E Oct. 20, 2019, 11:21 p.m. OK GNU C++17 TESTS 87 530 20787200 2100
63039724 Aleks5d E Oct. 20, 2019, 11:29 p.m. OK GNU C++17 TESTS 87 560 20889600 2100
63039585 Aleks5d E Oct. 20, 2019, 11:22 p.m. OK GNU C++17 TESTS 87 684 20787200 2100
63039123 ShadowLight E Oct. 20, 2019, 10:57 p.m. OK GNU C++17 TESTS 87 1028 20787200 2100
63039061 Aleks5d E Oct. 20, 2019, 10:54 p.m. OK GNU C++17 TESTS 87 1028 20787200 2100
2510862 watashi E Nov. 5, 2012, 12:39 p.m. OK Haskell TESTS 87 3734 75673600 2100
4262422 crazyfeel E Aug. 10, 2013, 4:55 p.m. OK Haskell TESTS 87 3806 205004800 2100
4262349 crazyfeel E Aug. 10, 2013, 4:23 p.m. OK Haskell TESTS 87 3868 205004800 2100
4270523 marty.stranger E Aug. 12, 2013, 5:50 p.m. OK Haskell TESTS 87 3962 205004800 2100
2601374 ahmad_mamdouh E Nov. 19, 2012, 6:58 p.m. OK Java 6 TESTS 87 1296 85606400 2100
1835410 uj. E June 28, 2012, 12:23 a.m. OK Java 6 TESTS 87 1700 138752000 2100
1835398 Ahmed.Ibrahem E June 27, 2012, 11:13 p.m. OK Java 6 TESTS 87 1700 138752000 2100
2669816 apollo E Nov. 27, 2012, 5:43 p.m. OK Java 6 TESTS 87 2828 88780800 2100
1835386 Ahmed.Ibrahem E June 27, 2012, 10:47 p.m. OK Java 6 TESTS 87 3500 166092800 2100
2088231 tsukuno E Sept. 1, 2012, 3:29 p.m. OK Java 6 TESTS 87 3800 104857600 2100
4314527 jcomputer000 E Aug. 20, 2013, 4:55 a.m. OK Java 6 TESTS 87 3992 78131200 2100
4284235 trunghieu11 E Aug. 16, 2013, 1:17 a.m. OK Java 7 TESTS 87 1184 30105600 2100
15677818 DukeOfYork E Jan. 30, 2016, 11:58 a.m. OK Java 7 TESTS 87 1278 24780800 2100
6453256 I_love_Malika E April 23, 2014, 11:36 a.m. OK Java 7 TESTS 87 1620 42393600 2100
5657434 miguelmaurizio E Jan. 11, 2014, 12:38 a.m. OK Java 7 TESTS 87 1652 46387200 2100
4314482 DoublePointer E Aug. 20, 2013, 4:26 a.m. OK Java 7 TESTS 87 1684 78233600 2100
9791691 Guliash E Feb. 10, 2015, 5:39 p.m. OK Java 7 TESTS 87 1776 41779200 2100
3477261 ixxa E April 5, 2013, 3:23 p.m. OK Java 7 TESTS 87 1953 185548800 2100
11490301 alibaba E June 7, 2015, 5:17 p.m. OK Java 7 TESTS 87 2058 77619200 2100
4500940 hama-du E Sept. 19, 2013, 5 a.m. OK Java 7 TESTS 87 2432 86528000 2100
4490952 santjuan E Sept. 17, 2013, 10:29 p.m. OK Java 7 TESTS 87 2870 139980800 2100
69376026 ajkdrag E Jan. 22, 2020, 6:12 p.m. OK Java 8 TESTS 87 842 54374400 2100
53467080 vjudge2 E April 28, 2019, 10:44 a.m. OK Java 8 TESTS 87 1122 18124800 2100
59549332 StayAwayFromBitches E Aug. 27, 2019, 1:35 a.m. OK Java 8 TESTS 87 1122 18739200 2100
34634804 HardikDobariya E Jan. 28, 2018, 2:01 p.m. OK Java 8 TESTS 87 1122 40960000 2100
53467094 aminul E April 28, 2019, 10:44 a.m. OK Java 8 TESTS 87 1152 18124800 2100
59547797 Ahmad E Aug. 26, 2019, 11:53 p.m. OK Java 8 TESTS 87 1154 19456000 2100
34085987 rahulkhairwar E Jan. 11, 2018, 10:57 a.m. OK Java 8 TESTS 87 1154 42496000 2100
34085901 rahulkhairwar E Jan. 11, 2018, 10:50 a.m. OK Java 8 TESTS 87 1184 42496000 2100
34085899 rahulkhairwar E Jan. 11, 2018, 10:50 a.m. OK Java 8 TESTS 87 1184 42496000 2100
34260236 kamalkishor1991 E Jan. 17, 2018, 7:10 p.m. OK Java 8 TESTS 87 1216 41369600 2100
69073853 vjudge3 E Jan. 19, 2020, 1:15 a.m. OK MS C++ TESTS 87 996 20787200 2100
49074979 vjudge4 E Jan. 28, 2019, 1:57 a.m. OK MS C++ TESTS 87 996 32051200 2100
64205801 vjudge5 E Nov. 4, 2019, 12:49 p.m. OK MS C++ TESTS 87 998 20787200 2100
49100028 vjudge3 E Jan. 28, 2019, 11:01 a.m. OK MS C++ TESTS 87 998 20787200 2100
51401679 vjudge5 E March 17, 2019, 7:42 a.m. OK MS C++ TESTS 87 1028 21299200 2100
54022625 vjudge1 E May 12, 2019, 10:42 a.m. OK MS C++ TESTS 87 1028 40140800 2100
54011189 vjudge2 E May 12, 2019, 2:30 a.m. OK MS C++ TESTS 87 1058 24064000 2100
25121323 vjudge1 E March 1, 2017, 11:08 a.m. OK MS C++ TESTS 87 1060 22937600 2100
29128606 vjudge3 E Aug. 2, 2017, 11:42 a.m. OK MS C++ TESTS 87 1060 58982400 2100
69097637 vjudge1 E Jan. 19, 2020, 12:42 p.m. OK MS C++ TESTS 87 1090 20889600 2100
67653455 wp32pw E Dec. 26, 2019, 1:02 p.m. OK MS C++ 2017 TESTS 87 1370 20787200 2100
56974981 2462478392 E July 13, 2019, 11:52 a.m. OK MS C++ 2017 TESTS 87 1590 20787200 2100
67653346 wp32pw E Dec. 26, 2019, 1 p.m. OK MS C++ 2017 TESTS 87 3088 21094400 2100
67653095 wp32pw E Dec. 26, 2019, 12:54 p.m. OK MS C++ 2017 TESTS 87 3118 21094400 2100
59545634 siwei E Aug. 26, 2019, 9:37 p.m. OK MS C++ 2017 TESTS 87 3524 20787200 2100
59576257 LowR E Aug. 27, 2019, 2:15 p.m. OK Rust TESTS 87 904 58368000 2100

remove filters

Back to search problems