Codeforces Round 500 (Div. 2) [based on EJOI]

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
1013 Codeforces Round 500 (Div. 2) [based on EJOI] FINISHED False 9000 198884699 July 30, 2018, 8:15 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7682 ) B And PROGRAMMING greedy 1200

B"There is an array with n elements a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an and the number x. In one operation you can select some i (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) and replace element ai with ai xe2 x80 x89& xe2 x80 x89x, where & denotes the bitwise and operation. You want the array to have at least two equal elements after applying some operations (possibly, none). In other words, there should be at least two distinct indices i xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89j such that ai xe2 x80 x89= xe2 x80 x89aj. Determine whether it is possible to achieve and, if possible, the minimal number of operations to apply. The first line contains integers n and x (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000), number of elements in the array and the number to and with. The second line contains n integers ai (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000), the elements of the array. Print a single integer denoting the minimal number of operations to do, or -1, if it is impossible. In the first example one can apply the operation to the last element of the array. That replaces 7 with 3, so we achieve the goal in one move. In the second example the array already has two equal elements. In the third example applying the operation won't change the array at all, so it is impossible to make some pair of elements equal. "...

Tutorials

Codeforces Round #500 (based on EJOI 2018) — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
41804558 rr_ B Aug. 18, 2018, 8:43 p.m. OK D TESTS 75 77 22425600 1200
40947245 ia7ck B July 30, 2018, 8:38 a.m. OK D TESTS 75 78 22425600 1200
40956489 ruban B July 30, 2018, 9:20 a.m. OK Delphi TESTS 75 93 73728000 1200
40963492 valentinzhodino B July 30, 2018, 10:14 a.m. OK FPC TESTS 75 31 819200 1200
40952032 xqf123 B July 30, 2018, 8:56 a.m. OK FPC TESTS 75 46 409600 1200
41231002 BattleCry B Aug. 5, 2018, 2:59 a.m. OK FPC TESTS 75 46 819200 1200
41376416 Time_Lord_JScoder B Aug. 8, 2018, 9:18 p.m. OK FPC TESTS 75 46 1433600 1200
40977262 1Demiurg B July 30, 2018, 4:06 p.m. OK FPC TESTS 75 46 1638400 1200
40951299 TShT B July 30, 2018, 8:53 a.m. OK FPC TESTS 75 46 4812800 1200
51471785 chaorenhaha B March 19, 2019, 6:59 a.m. OK FPC TESTS 75 46 11980800 1200
40961257 wjhh B July 30, 2018, 9:54 a.m. OK FPC TESTS 75 62 409600 1200
40960227 hlyti300 B July 30, 2018, 9:46 a.m. OK FPC TESTS 75 62 1638400 1200
42711763 DarkAvengerr B Sept. 9, 2018, 4:37 p.m. OK FPC TESTS 75 77 2355200 1200
40958852 aeri_aurbis B July 30, 2018, 9:35 a.m. OK GNU C TESTS 75 31 819200 1200
41238438 DravenX618 B Aug. 5, 2018, 8:39 a.m. OK GNU C TESTS 75 46 819200 1200
41005030 RenKai_Z B July 31, 2018, 9:13 a.m. OK GNU C TESTS 75 46 819200 1200
41004197 Alaa_hboubati B July 31, 2018, 8:47 a.m. OK GNU C TESTS 75 46 819200 1200
40971555 egg23333 B July 30, 2018, 1:24 p.m. OK GNU C TESTS 75 46 819200 1200
40955649 doublebit B July 30, 2018, 9:15 a.m. OK GNU C TESTS 75 46 819200 1200
40953183 orbion B July 30, 2018, 9:02 a.m. OK GNU C TESTS 75 46 819200 1200
40951176 likcoras B July 30, 2018, 8:53 a.m. OK GNU C TESTS 75 46 819200 1200
41238258 howard919901 B Aug. 5, 2018, 8:32 a.m. OK GNU C TESTS 75 46 1228800 1200
40964886 newbieski B July 30, 2018, 10:27 a.m. OK GNU C TESTS 75 46 1228800 1200
41240458 pufanyi B Aug. 5, 2018, 9:55 a.m. OK GNU C++ TESTS 75 31 204800 1200
41574389 Wahh B Aug. 14, 2018, 2:48 a.m. OK GNU C++ TESTS 75 31 204800 1200
40947177 UranusITS B July 30, 2018, 8:38 a.m. OK GNU C++ TESTS 75 31 204800 1200
40949417 C20193620 B July 30, 2018, 8:46 a.m. OK GNU C++ TESTS 75 31 307200 1200
41886088 romiqi B Aug. 20, 2018, 3:52 a.m. OK GNU C++ TESTS 75 31 409600 1200
40992274 vjudge5 B July 31, 2018, 1:12 a.m. OK GNU C++ TESTS 75 31 409600 1200
40949386 hzoi_zhzsx B July 30, 2018, 8:46 a.m. OK GNU C++ TESTS 75 31 409600 1200
40948620 MakiseKurisu004 B July 30, 2018, 8:43 a.m. OK GNU C++ TESTS 75 31 409600 1200
40946066 _CZH B July 30, 2018, 8:34 a.m. OK GNU C++ TESTS 75 31 409600 1200
41127186 wuruzhao B Aug. 2, 2018, 2:50 p.m. OK GNU C++ TESTS 75 31 512000 1200
64093567 Syins B Nov. 2, 2019, 1:18 p.m. OK GNU C11 TESTS 75 31 819200 1200
41003240 LudwigVanBeethoven B July 31, 2018, 8:17 a.m. OK GNU C11 TESTS 75 31 1228800 1200
40969335 pandrei B July 30, 2018, 12:39 p.m. OK GNU C11 TESTS 75 46 819200 1200
52826809 pranaykanjolia B April 16, 2019, 2:04 p.m. OK GNU C11 TESTS 75 46 819200 1200
60335512 You_Know_Who B Sept. 10, 2019, 8:19 a.m. OK GNU C11 TESTS 75 46 1228800 1200
40967091 dodge2 B July 30, 2018, 10:44 a.m. OK GNU C11 TESTS 75 62 819200 1200
48498642 NoSoul B Jan. 17, 2019, 2:01 p.m. OK GNU C11 TESTS 75 62 819200 1200
57866427 sidtiw_ saukr1006 Rishu15 B July 27, 2019, 9:21 p.m. OK GNU C11 TESTS 75 62 819200 1200
40954366 rianandabp B July 30, 2018, 9:08 a.m. OK GNU C++11 TESTS 75 31 204800 1200
40947585 sky666 B July 30, 2018, 8:39 a.m. OK GNU C++11 TESTS 75 31 204800 1200
48287619 whhQAQ B Jan. 12, 2019, 11:22 a.m. OK GNU C++11 TESTS 75 31 409600 1200
40954528 ygy B July 30, 2018, 9:08 a.m. OK GNU C++11 TESTS 75 31 409600 1200
40950206 MaxYellow B July 30, 2018, 8:49 a.m. OK GNU C++11 TESTS 75 31 409600 1200
61222717 luogu_bot4 B Sept. 24, 2019, 2:22 p.m. OK GNU C++11 TESTS 75 31 409600 1200
41675842 PrimeMinister B Aug. 17, 2018, 8 a.m. OK GNU C++11 TESTS 75 31 409600 1200
51842885 Ufowoqqqo B March 26, 2019, 12:40 a.m. OK GNU C++11 TESTS 75 31 512000 1200
52235220 cang_qiong B April 2, 2019, 1:30 p.m. OK GNU C++11 TESTS 75 31 512000 1200
47443433 zerombie B Dec. 24, 2018, 4:13 a.m. OK GNU C++11 TESTS 75 31 512000 1200
42002043 satu0king B Aug. 23, 2018, 3:49 p.m. OK GNU C++14 TESTS 75 31 204800 1200
40947372 KyuJeong B July 30, 2018, 8:38 a.m. OK GNU C++14 TESTS 75 31 614400 1200
41154837 IIeJlMeHb B Aug. 3, 2018, 11:26 a.m. OK GNU C++14 TESTS 75 31 1228800 1200
41939329 pranav_gupta B Aug. 21, 2018, 2:28 p.m. OK GNU C++14 TESTS 75 31 1638400 1200
40944806 Mikpol B July 30, 2018, 8:30 a.m. OK GNU C++14 TESTS 75 31 1638400 1200
40976678 majinboo B July 30, 2018, 3:50 p.m. OK GNU C++14 TESTS 75 31 8396800 1200
40946917 Peti B July 30, 2018, 8:37 a.m. OK GNU C++14 TESTS 75 46 0 1200
52604174 Learnerxy B April 11, 2019, 1:13 p.m. OK GNU C++14 TESTS 75 46 204800 1200
48190163 KasugaAyumu B Jan. 10, 2019, 5:25 p.m. OK GNU C++14 TESTS 75 46 204800 1200
62623835 Starscream-11813 B Oct. 15, 2019, 1:33 p.m. OK GNU C++14 TESTS 75 46 204800 1200
64080744 CQXYM B Nov. 2, 2019, 10:10 a.m. OK GNU C++17 TESTS 75 31 409600 1200
43244617 MusabbirAhmed101 B Sept. 22, 2018, 11:07 a.m. OK GNU C++17 TESTS 75 31 1024000 1200
40969940 Abdelrhman_Akram B July 30, 2018, 12:49 p.m. OK GNU C++17 TESTS 75 31 1228800 1200
40999169 UnstoppableChillMachine B July 31, 2018, 6:11 a.m. OK GNU C++17 TESTS 75 31 1228800 1200
52160640 vjudge2 B April 1, 2019, 3:07 p.m. OK GNU C++17 TESTS 75 31 1433600 1200
41129993 smit_mandavia B Aug. 2, 2018, 4:44 p.m. OK GNU C++17 TESTS 75 46 204800 1200
40971167 VaVshchuck B July 30, 2018, 1:16 p.m. OK GNU C++17 TESTS 75 46 204800 1200
56145683 vjudge2 B June 27, 2019, 6:08 a.m. OK GNU C++17 TESTS 75 46 204800 1200
56148568 vjudge1 B June 27, 2019, 7:19 a.m. OK GNU C++17 TESTS 75 46 204800 1200
56144818 vjudge1 B June 27, 2019, 5:41 a.m. OK GNU C++17 TESTS 75 46 204800 1200
47128980 sandun B Dec. 16, 2018, 4:05 p.m. OK Go TESTS 75 46 5222400 1200
47124264 sandun B Dec. 16, 2018, 3:33 p.m. OK Go TESTS 75 46 5324800 1200
41194229 gokjer B Aug. 3, 2018, 10:14 p.m. OK Haskell TESTS 75 499 22220800 1200
41138360 Omrigan B Aug. 3, 2018, 12:03 a.m. OK Haskell TESTS 75 514 15974400 1200
40946144 Haskell_for_a_pint B July 30, 2018, 8:34 a.m. OK Haskell TESTS 75 530 18022400 1200
69795048 Hemose B Jan. 29, 2020, 7:47 p.m. OK Java 11 TESTS 75 249 3481600 1200
69505359 conquerorArpit B Jan. 25, 2020, 8:21 a.m. OK Java 8 TESTS 75 124 0 1200
59214171 garnacha B Aug. 21, 2019, 9:35 a.m. OK Java 8 TESTS 75 124 0 1200
44462287 dududumALT B Oct. 17, 2018, 9:28 p.m. OK Java 8 TESTS 75 124 0 1200
41089138 Itwazonce B Aug. 1, 2018, 3:39 p.m. OK Java 8 TESTS 75 124 0 1200
40979302 MaxHeap B July 30, 2018, 5:01 p.m. OK Java 8 TESTS 75 124 0 1200
40972513 parth_15 B July 30, 2018, 1:49 p.m. OK Java 8 TESTS 75 124 0 1200
41315569 apurvaj B Aug. 7, 2018, 7:18 p.m. OK Java 8 TESTS 75 139 0 1200
40952754 the_law10 B July 30, 2018, 9 a.m. OK Java 8 TESTS 75 139 0 1200
40944716 ShowStopper728 B July 30, 2018, 8:30 a.m. OK Java 8 TESTS 75 139 0 1200
65415020 YazanAssaf B Nov. 20, 2019, 6:28 a.m. OK Java 8 TESTS 75 140 0 1200
40941775 0442A403 B July 30, 2018, 8:21 a.m. OK Kotlin TESTS 75 311 1638400 1200
40944290 final_child B July 30, 2018, 8:28 a.m. OK Kotlin TESTS 75 405 5836800 1200
41123103 Mickey-snow B Aug. 2, 2018, 12:56 p.m. OK Mono C# TESTS 75 62 8806400 1200
40998114 Sardarr B July 31, 2018, 5:33 a.m. OK Mono C# TESTS 75 77 716800 1200
40999053 Sardarr B July 31, 2018, 6:07 a.m. OK Mono C# TESTS 75 77 6348800 1200
40999170 LostSomewhereElse B July 31, 2018, 6:11 a.m. OK Mono C# TESTS 75 77 6348800 1200
48053630 tamunsio B Jan. 7, 2019, 10:53 a.m. OK Mono C# TESTS 75 77 7372800 1200
40943281 keymoon B July 30, 2018, 8:25 a.m. OK Mono C# TESTS 75 77 11980800 1200
52224287 MinProph B April 2, 2019, 8:30 a.m. OK Mono C# TESTS 75 78 6963200 1200
41146849 fr0st B Aug. 3, 2018, 6:58 a.m. OK Mono C# TESTS 75 78 45363200 1200
42484108 Skndr801 B Sept. 5, 2018, 7:53 a.m. OK Mono C# TESTS 75 93 7372800 1200
55677053 og.kostya B June 17, 2019, 11 a.m. OK Mono C# TESTS 75 93 8806400 1200
64017788 vjudge3 B Nov. 1, 2019, 3:28 p.m. OK MS C++ TESTS 75 31 204800 1200
41209890 vjudge5 B Aug. 4, 2018, 9:56 a.m. OK MS C++ TESTS 75 31 819200 1200
41250283 vjudge5 B Aug. 5, 2018, 3:42 p.m. OK MS C++ TESTS 75 31 1228800 1200
53187324 vjudge4 B April 23, 2019, 11:06 a.m. OK MS C++ TESTS 75 31 1228800 1200
41410051 CrashMaster B Aug. 9, 2018, 7:29 p.m. OK MS C++ TESTS 75 31 1228800 1200
52159686 vjudge5 B April 1, 2019, 2:43 p.m. OK MS C++ TESTS 75 31 1228800 1200
45857200 vjudge5 B Nov. 17, 2018, 2:56 a.m. OK MS C++ TESTS 75 31 1228800 1200
53122477 vjudge1 B April 22, 2019, 12:06 p.m. OK MS C++ TESTS 75 31 1228800 1200
45621887 scorpiowf B Nov. 12, 2018, 3:56 p.m. OK MS C++ TESTS 75 46 512000 1200
52151629 vjudge5 B April 1, 2019, 11:50 a.m. OK MS C++ TESTS 75 46 512000 1200
52156271 tomjobs B April 1, 2019, 1:32 p.m. OK MS C++ 2017 TESTS 75 78 819200 1200
52156353 tomjobs B April 1, 2019, 1:34 p.m. OK MS C++ 2017 TESTS 75 93 819200 1200
52156323 tomjobs B April 1, 2019, 1:33 p.m. OK MS C++ 2017 TESTS 75 93 819200 1200
52156434 tomjobs B April 1, 2019, 1:35 p.m. OK MS C++ 2017 TESTS 75 93 1228800 1200
62352875 Kirja_ES B Oct. 11, 2019, 9:57 a.m. OK MS C++ 2017 TESTS 75 93 3276800 1200
58803062 vjudge2 B Aug. 14, 2019, 8 a.m. OK MS C++ 2017 TESTS 75 93 35430400 1200
57594712 CtrlAlt B July 23, 2019, 1:32 p.m. OK MS C++ 2017 TESTS 75 108 2867200 1200
59111018 Vovkaez B Aug. 19, 2019, 8:44 p.m. OK MS C++ 2017 TESTS 75 109 819200 1200
64735770 vjudge2 B Nov. 12, 2019, 10:16 a.m. OK MS C++ 2017 TESTS 75 109 1126400 1200
40956738 PAG B July 30, 2018, 9:21 a.m. OK PascalABC.NET TESTS 75 93 307200 1200
40957403 Egor_Shchetinin B July 30, 2018, 9:25 a.m. OK PascalABC.NET TESTS 75 93 4198400 1200
40948604 OpKos B July 30, 2018, 8:43 a.m. OK PascalABC.NET TESTS 75 108 3686400 1200
40962117 henrysc B July 30, 2018, 10:01 a.m. OK PascalABC.NET TESTS 75 109 4198400 1200
41011620 kd710306 B July 31, 2018, 12:59 p.m. OK PyPy 2 TESTS 75 140 5939200 1200
40946757 a03090 B July 30, 2018, 8:36 a.m. OK PyPy 2 TESTS 75 140 6656000 1200
40953573 akshay125 B July 30, 2018, 9:04 a.m. OK PyPy 2 TESTS 75 140 9523200 1200
43735464 soumyasarkar1998 B Oct. 3, 2018, 3:50 p.m. OK PyPy 2 TESTS 75 155 6758400 1200
40975522 pavankatta B July 30, 2018, 3:14 p.m. OK PyPy 2 TESTS 75 171 11980800 1200
41139021 aeternalis1 B Aug. 3, 2018, 1:02 a.m. OK PyPy 2 TESTS 75 187 10752000 1200
41005686 kakkarotssj B July 31, 2018, 9:32 a.m. OK PyPy 2 TESTS 75 202 13824000 1200
41887511 SerChirag B Aug. 20, 2018, 4:57 a.m. OK PyPy 2 TESTS 75 217 12800000 1200
40948596 rkstalker B July 30, 2018, 8:43 a.m. OK PyPy 2 TESTS 75 249 15667200 1200
40969057 pa.n.ik B July 30, 2018, 12:35 p.m. OK PyPy 2 TESTS 75 264 84992000 1200
69924658 adityajn105 B Jan. 31, 2020, 7:48 p.m. OK PyPy 3 TESTS 75 187 10035200 1200
54320677 chaudhary_19 B May 17, 2019, 8:54 p.m. OK PyPy 3 TESTS 75 187 11059200 1200
49244884 shaswat57 B Jan. 31, 2019, 12:09 p.m. OK PyPy 3 TESTS 75 187 11161600 1200
47516560 bupt.wc B Dec. 26, 2018, 10:20 a.m. OK PyPy 3 TESTS 75 187 11264000 1200
59326318 kchau B Aug. 22, 2019, 8:52 p.m. OK PyPy 3 TESTS 75 202 10342400 1200
41106079 UncleGrandpa B Aug. 2, 2018, 4:13 a.m. OK PyPy 3 TESTS 75 202 10956800 1200
48606752 toysheeyeyraku B Jan. 20, 2019, 11:23 a.m. OK PyPy 3 TESTS 75 202 11059200 1200
44632986 omarnvidia B Oct. 21, 2018, 8:48 a.m. OK PyPy 3 TESTS 75 202 11161600 1200
41233648 USYD_Yemengchen B Aug. 5, 2018, 5:51 a.m. OK PyPy 3 TESTS 75 202 11161600 1200
41233607 USYD_Yemengchen B Aug. 5, 2018, 5:48 a.m. OK PyPy 3 TESTS 75 202 11161600 1200
40989231 jwk B July 30, 2018, 10:43 p.m. OK Python 2 TESTS 75 249 5324800 1200
41270826 Andromedayu B Aug. 6, 2018, 10:09 a.m. OK Python 2 TESTS 75 264 5836800 1200
41069946 bhelkey B July 31, 2018, 10:30 p.m. OK Python 2 TESTS 75 264 8601600 1200
41000431 franckmy B July 31, 2018, 6:50 a.m. OK Python 2 TESTS 75 265 5324800 1200
41129207 wangkan2001 B Aug. 2, 2018, 4:08 p.m. OK Python 2 TESTS 75 265 5427200 1200
40950191 mihir_94 B July 30, 2018, 8:49 a.m. OK Python 2 TESTS 75 280 5427200 1200
40949209 slitvinov B July 30, 2018, 8:45 a.m. OK Python 2 TESTS 75 280 5427200 1200
47680387 biltharesatyendra B Dec. 29, 2018, 11:46 a.m. OK Python 2 TESTS 75 280 6451200 1200
40960333 elistark B July 30, 2018, 9:46 a.m. OK Python 2 TESTS 75 280 6451200 1200
41005718 kakkarotssj B July 31, 2018, 9:32 a.m. OK Python 2 TESTS 75 280 11776000 1200
44956593 Playfair B Oct. 27, 2018, 2:32 p.m. OK Python 3 TESTS 75 171 7372800 1200
40981405 wmgts12 B July 30, 2018, 5:58 p.m. OK Python 3 TESTS 75 171 7372800 1200
41564534 CodeCreator B Aug. 13, 2018, 4:36 p.m. OK Python 3 TESTS 75 171 7475200 1200
41531759 CooLeash B Aug. 12, 2018, 2:52 p.m. OK Python 3 TESTS 75 171 7475200 1200
41530490 shvechikov B Aug. 12, 2018, 2:13 p.m. OK Python 3 TESTS 75 171 7475200 1200
40970477 maximkm B July 30, 2018, 1 p.m. OK Python 3 TESTS 75 171 7577600 1200
47801947 xiejunzhong2000 B Jan. 1, 2019, 12:56 a.m. OK Python 3 TESTS 75 171 7680000 1200
41089417 wangzpeng B Aug. 1, 2018, 3:46 p.m. OK Python 3 TESTS 75 171 7680000 1200
41124028 Vasiliy_48 B Aug. 2, 2018, 1:22 p.m. OK Python 3 TESTS 75 186 7680000 1200
40944334 Kelang B July 30, 2018, 8:28 a.m. OK Python 3 TESTS 75 186 7884800 1200
49302223 vjudge2 B Feb. 1, 2019, 3:52 a.m. OK Ruby TESTS 75 140 11264000 1200
41307821 betrue12 B Aug. 7, 2018, 2:02 p.m. OK Ruby TESTS 75 202 13004800 1200
46396296 georg.rollinger B Nov. 30, 2018, 9:29 a.m. OK Scala TESTS 75 545 4505600 1200
46396164 akaigorodov B Nov. 30, 2018, 9:24 a.m. OK Scala TESTS 75 624 5836800 1200

remove filters

Back to search problems