Codeforces Global Round 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
1119 Codeforces Global Round 2 FINISHED False 7200 182975123 April 6, 2019, 11:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10917 ) A Ilya and a Colorful Walk PROGRAMMING greedy implementation 1100

B'Ilya lives in a beautiful city of Chordalsk. There are n houses on the street Ilya lives, they are numerated from 1 to n from left to right; the distance between every two neighboring houses is equal to 1 unit. The neighboring houses are 1 and 2 , 2 and 3 , ..., n-1 and n . The houses n and 1 are not neighboring. The houses are colored in colors c_1, c_2, ldots, c_n so that the i -th house is colored in the color c_i . Everyone knows that Chordalsk is not boring, so there are at least two houses colored in different colors. Ilya wants to select two houses i and j so that 1 <= q i < j <= q n , and they have different colors: c_i neq c_j . He will then walk from the house i to the house j the distance of (j-i) units. Ilya loves long walks, so he wants to choose the houses so that the distance between them is the maximum possible. Help Ilya, find this maximum possible distance. The first line contains a single integer n ( 3 <= q n <= q 300 ,000 ) -- the number of cities on the street. The second line contains n integers c_1, c_2, ldots, c_n ( 1 <= q c_i <= q n ) -- the colors of the houses. It is guaranteed that there is at least one pair of indices i and j so that 1 <= q i < j <= q n and c_i neq c_j . Print a single integer -- the maximum possible distance Ilya can walk. In the first example the optimal way is to walk from the first house to the last one, where Ilya can walk the distance of 5-1 = 4 units. In the second example the optimal way is to either walk from the first house to the second or from the second to the third. Both these ways have the distance of 1 unit. In the third example the optimal way is to walk from the third house to the last one, where Ilya can walk the distance of 7-3 = 4 units. '...

Tutorials

Codeforces Global Round 2 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
52424770 vjudge5 A April 6, 2019, 6:49 p.m. OK Clang++17 Diagnostics TESTS 79 124 1228800 1100
52442822 bzEq A April 7, 2019, 6:57 a.m. OK Clang++17 Diagnostics TESTS 79 156 3276800 1100
52586319 VROOM_VARUN A April 11, 2019, 12:27 a.m. OK Clang++17 Diagnostics TESTS 79 1201 1228800 1100
53176791 Mahmud59 A April 23, 2019, 4:28 a.m. OK Clang++17 Diagnostics TESTS 79 1247 2355200 1100
52417488 MZuenni A April 6, 2019, 3:40 p.m. OK Clang++17 Diagnostics TESTS 79 1279 0 1100
57698783 reyhan_abt A July 24, 2019, 5:14 p.m. OK Clang++17 Diagnostics TESTS 79 1279 1228800 1100
52392334 hos.lyric A April 6, 2019, 11:57 a.m. OK D TESTS 79 93 22118400 1100
52415132 Denor A April 6, 2019, 3 p.m. OK Delphi TESTS 79 77 1228800 1100
52524160 svbor2000 A April 9, 2019, 10:36 a.m. OK Delphi TESTS 79 77 1331200 1100
52416435 ruban A April 6, 2019, 3:17 p.m. OK Delphi TESTS 79 93 13926400 1100
52675178 dblark A April 13, 2019, 9:15 a.m. OK FPC TESTS 79 77 1228800 1100
52394295 dblark A April 6, 2019, 12:03 p.m. OK FPC TESTS 79 77 1228800 1100
52766996 hkwalker A April 15, 2019, 4:58 a.m. OK FPC TESTS 79 77 1433600 1100
52393477 d4rkn19ht A April 6, 2019, noon OK FPC TESTS 79 77 3993600 1100
52392056 Craspedacusta A April 6, 2019, 11:56 a.m. OK FPC TESTS 79 77 11980800 1100
52395286 Bear.-. A April 6, 2019, 12:06 p.m. OK FPC TESTS 79 93 1433600 1100
52410133 PAG A April 6, 2019, 1:24 p.m. OK FPC TESTS 79 93 3584000 1100
52389638 kfhkx A April 6, 2019, 11:49 a.m. OK FPC TESTS 79 93 120524800 1100
56732119 gregr A July 9, 2019, 2:16 a.m. OK GNU C11 TESTS 79 61 1228800 1100
56731662 gregr A July 9, 2019, 1:54 a.m. OK GNU C11 TESTS 79 62 1228800 1100
59589990 IndianPirate A Aug. 27, 2019, 7:54 p.m. OK GNU C11 TESTS 79 62 1228800 1100
62439422 _null_ptr_ A Oct. 12, 2019, 6:45 p.m. OK GNU C11 TESTS 79 62 1228800 1100
65446760 DevJewel A Nov. 20, 2019, 4:17 p.m. OK GNU C11 TESTS 79 62 1228800 1100
67154704 vjudge2 A Dec. 18, 2019, 12:06 p.m. OK GNU C11 TESTS 79 62 1228800 1100
68389338 yigezhe A Jan. 8, 2020, 7:50 a.m. OK GNU C11 TESTS 79 62 1228800 1100
54850679 A_M_Saiyef A May 30, 2019, 4:25 p.m. OK GNU C11 TESTS 79 62 1228800 1100
55129214 __Enigma__ A June 5, 2019, 2:23 p.m. OK GNU C11 TESTS 79 62 1228800 1100
55679468 ktk54x A June 17, 2019, 12:16 p.m. OK GNU C11 TESTS 79 62 1228800 1100
52547039 yuy A April 9, 2019, 10:43 p.m. OK GNU C++11 TESTS 79 31 1024000 1100
56149750 xgzc A June 27, 2019, 7:44 a.m. OK GNU C++11 TESTS 79 31 1024000 1100
62541257 LuciferX07 A Oct. 14, 2019, 3:33 a.m. OK GNU C++11 TESTS 79 31 1024000 1100
52456558 Madana A April 7, 2019, 11:58 a.m. OK GNU C++11 TESTS 79 31 1024000 1100
52523387 yuy A April 9, 2019, 10:09 a.m. OK GNU C++11 TESTS 79 31 1024000 1100
52523404 yuy A April 9, 2019, 10:10 a.m. OK GNU C++11 TESTS 79 31 1024000 1100
54064546 luogu_bot4 A May 13, 2019, 12:48 p.m. OK GNU C++11 TESTS 79 31 1228800 1100
56962610 CN_zwang2002 A July 13, 2019, 7:10 a.m. OK GNU C++11 TESTS 79 31 1228800 1100
55322628 luogu_bot4 A June 9, 2019, 5:56 a.m. OK GNU C++11 TESTS 79 31 1228800 1100
54896272 M_sea A June 1, 2019, 3:01 a.m. OK GNU C++11 TESTS 79 31 1228800 1100
52395561 BB13 A April 6, 2019, 12:07 p.m. OK GNU C++14 TESTS 79 62 0 1100
64797201 vjudge4 A Nov. 13, 2019, 1:18 p.m. OK GNU C++14 TESTS 79 62 1126400 1100
55088871 vjudge1 A June 4, 2019, 1:40 p.m. OK GNU C++14 TESTS 79 62 1228800 1100
60067809 vjudge1 A Sept. 5, 2019, 9:52 a.m. OK GNU C++14 TESTS 79 62 1228800 1100
52778493 H4XeO6 A April 15, 2019, 1:06 p.m. OK GNU C++14 TESTS 79 62 1228800 1100
52536797 TOGOTOO A April 9, 2019, 4 p.m. OK GNU C++14 TESTS 79 62 1228800 1100
52530318 adds136078 A April 9, 2019, 1:13 p.m. OK GNU C++14 TESTS 79 62 1228800 1100
52452287 ..vince A April 7, 2019, 10:17 a.m. OK GNU C++14 TESTS 79 62 1228800 1100
52416604 threepebbles A April 6, 2019, 3:20 p.m. OK GNU C++14 TESTS 79 62 1228800 1100
52519080 SHYang A April 9, 2019, 7:37 a.m. OK GNU C++14 TESTS 79 62 1945600 1100
54266734 LiChenKoh A May 17, 2019, 6:27 a.m. OK GNU C++17 TESTS 79 31 1228800 1100
52678683 .tx A April 13, 2019, 11:05 a.m. OK GNU C++17 TESTS 79 46 1228800 1100
52399280 garman A April 6, 2019, 12:23 p.m. OK GNU C++17 TESTS 79 46 2457600 1100
52418323 chiabhoward A April 6, 2019, 4 p.m. OK GNU C++17 TESTS 79 62 0 1100
64794040 Euphonium A Nov. 13, 2019, 12:16 p.m. OK GNU C++17 TESTS 79 62 1126400 1100
52592239 MxDev A April 11, 2019, 6:34 a.m. OK GNU C++17 TESTS 79 62 1126400 1100
52514207 powerkeke A April 9, 2019, 3:34 a.m. OK GNU C++17 TESTS 79 62 1126400 1100
53687582 RCG A May 3, 2019, 2:17 a.m. OK GNU C++17 TESTS 79 62 1126400 1100
54875228 Hasan_Saju A May 31, 2019, 11:28 a.m. OK GNU C++17 TESTS 79 62 1126400 1100
55087816 vjudge4 A June 4, 2019, 1:16 p.m. OK GNU C++17 TESTS 79 62 1126400 1100
52449620 suryanshv23 A April 7, 2019, 9:11 a.m. OK Go TESTS 79 218 716800 1100
52393617 Dekedro A April 6, 2019, 12:01 p.m. OK Go TESTS 79 249 4505600 1100
54973115 code_report A June 2, 2019, 9:28 a.m. OK Haskell TESTS 79 109 19046400 1100
52638495 rexim A April 12, 2019, 11:24 a.m. OK Haskell TESTS 79 670 67276800 1100
67267009 CodAR A Dec. 20, 2019, 6:36 a.m. OK Java 11 TESTS 79 499 0 1100
53995037 saurabh0611 A May 11, 2019, 2:09 p.m. OK Java 8 TESTS 79 124 0 1100
54908163 darshan287 A June 1, 2019, 9:48 a.m. OK Java 8 TESTS 79 124 0 1100
53975559 Jeel_Vaishnav A May 11, 2019, 3:39 a.m. OK Java 8 TESTS 79 124 0 1100
52810056 dalt A April 16, 2019, 8:01 a.m. OK Java 8 TESTS 79 124 0 1100
52640492 Ziklon A April 12, 2019, 12:15 p.m. OK Java 8 TESTS 79 124 0 1100
52515576 Ajudiya_13 A April 9, 2019, 5:01 a.m. OK Java 8 TESTS 79 124 0 1100
52449949 bluesky111 A April 7, 2019, 9:19 a.m. OK Java 8 TESTS 79 124 0 1100
52449695 bluesky111 A April 7, 2019, 9:13 a.m. OK Java 8 TESTS 79 124 0 1100
52426989 tsumit023 A April 6, 2019, 7:48 p.m. OK Java 8 TESTS 79 124 0 1100
52425157 shubhammitt A April 6, 2019, 6:59 p.m. OK Java 8 TESTS 79 124 0 1100
52394786 codedsaasd A April 6, 2019, 12:05 p.m. OK JavaScript TESTS 79 186 22732800 1100
53467235 I.A.K.O.V A April 28, 2019, 10:49 a.m. OK Kotlin TESTS 79 171 12390400 1100
52390499 Lishy2010 A April 6, 2019, 11:52 a.m. OK Kotlin TESTS 79 171 12390400 1100
52659830 yuizy A April 12, 2019, 9:36 p.m. OK Kotlin TESTS 79 234 18432000 1100
63769474 Spheniscine A Oct. 30, 2019, 7:27 a.m. OK Kotlin TESTS 79 249 15974400 1100
55111360 Mjgonzales A June 5, 2019, 6:26 a.m. OK Kotlin TESTS 79 405 26931200 1100
55111420 Mjgonzales A June 5, 2019, 6:28 a.m. OK Kotlin TESTS 79 436 26931200 1100
52470172 purple_haze1 A April 7, 2019, 6:03 p.m. OK Kotlin TESTS 79 514 8601600 1100
54839115 og.kostya A May 30, 2019, 12:03 p.m. OK Mono C# TESTS 79 62 1228800 1100
55995898 jose31309 A June 24, 2019, 10:24 a.m. OK Mono C# TESTS 79 108 25702400 1100
52419341 ansergeyg A April 6, 2019, 4:27 p.m. OK Mono C# TESTS 79 124 25804800 1100
52396361 Giangvp A April 6, 2019, 12:10 p.m. OK Mono C# TESTS 79 124 27033600 1100
52593705 Favarish A April 11, 2019, 7:34 a.m. OK Mono C# TESTS 79 124 27033600 1100
52389506 Rudolfking A April 6, 2019, 11:49 a.m. OK Mono C# TESTS 79 124 33894400 1100
52389354 riantkb A April 6, 2019, 11:49 a.m. OK Mono C# TESTS 79 124 35020800 1100
52450182 TRR A April 7, 2019, 9:24 a.m. OK Mono C# TESTS 79 139 28057600 1100
52389516 mustafa7 A April 6, 2019, 11:49 a.m. OK Mono C# TESTS 79 140 26931200 1100
52396056 amit1509kumar A April 6, 2019, 12:09 p.m. OK Mono C# TESTS 79 140 27033600 1100
64864355 vjudge5 A Nov. 14, 2019, 5:15 a.m. OK MS C++ TESTS 79 61 1228800 1100
53005013 vjudge1 A April 19, 2019, 9:07 a.m. OK MS C++ TESTS 79 61 2457600 1100
52560176 vjudge3 A April 10, 2019, 9:55 a.m. OK MS C++ TESTS 79 62 0 1100
66568318 vjudge4 A Dec. 10, 2019, 1:34 a.m. OK MS C++ TESTS 79 62 1228800 1100
65250983 vjudge4 A Nov. 17, 2019, noon OK MS C++ TESTS 79 62 1228800 1100
64795934 vjudge5 A Nov. 13, 2019, 12:53 p.m. OK MS C++ TESTS 79 62 1228800 1100
63471539 vjudge1 A Oct. 26, 2019, 12:12 p.m. OK MS C++ TESTS 79 62 1228800 1100
61962670 vjudge5 A Oct. 6, 2019, 7:56 a.m. OK MS C++ TESTS 79 62 1228800 1100
59203813 vjudge5 A Aug. 21, 2019, 6:08 a.m. OK MS C++ TESTS 79 62 1228800 1100
59201982 vjudge3 A Aug. 21, 2019, 5:21 a.m. OK MS C++ TESTS 79 62 1228800 1100
52557073 risa243 A April 10, 2019, 8:19 a.m. OK MS C++ 2017 TESTS 79 92 1228800 1100
52391025 swomack A April 6, 2019, 11:53 a.m. OK MS C++ 2017 TESTS 79 93 1228800 1100
52393824 llolitay A April 6, 2019, 12:01 p.m. OK MS C++ 2017 TESTS 79 93 1228800 1100
52394825 hwangganzi A April 6, 2019, 12:05 p.m. OK MS C++ 2017 TESTS 79 93 1228800 1100
52402116 eyesofgod123 A April 6, 2019, 12:38 p.m. OK MS C++ 2017 TESTS 79 93 1228800 1100
52389325 dkyun A April 6, 2019, 11:49 a.m. OK MS C++ 2017 TESTS 79 93 1228800 1100
52494049 Deadly_Brace A April 8, 2019, 12:55 p.m. OK MS C++ 2017 TESTS 79 93 1228800 1100
52650076 CtrlAlt A April 12, 2019, 4:12 p.m. OK MS C++ 2017 TESTS 79 93 1228800 1100
55089405 kkeey A June 4, 2019, 1:54 p.m. OK MS C++ 2017 TESTS 79 93 1228800 1100
52423778 biaohongWA A April 6, 2019, 6:22 p.m. OK MS C++ 2017 TESTS 79 93 1228800 1100
54881739 CyberGoose A May 31, 2019, 2:43 p.m. OK Ocaml TESTS 79 78 2355200 1100
52452006 SlavaYun A April 7, 2019, 10:10 a.m. OK PascalABC.NET TESTS 79 405 0 1100
52424948 olpurgin A April 6, 2019, 6:54 p.m. OK PascalABC.NET TESTS 79 483 1740800 1100
57764895 romanporsh A July 25, 2019, 7:44 p.m. OK PascalABC.NET TESTS 79 499 1843200 1100
52430821 CrazyDr A April 6, 2019, 10:39 p.m. OK PHP TESTS 79 77 33177600 1100
54420258 mayakin A May 20, 2019, 3:01 p.m. OK PHP TESTS 79 124 33177600 1100
52443573 beast18 A April 7, 2019, 7:13 a.m. OK PyPy 2 TESTS 79 155 18329600 1100
52404729 codeseeker A April 6, 2019, 12:53 p.m. OK PyPy 2 TESTS 79 171 12390400 1100
59883206 MVP A Sept. 2, 2019, 6:23 a.m. OK PyPy 2 TESTS 79 171 12595200 1100
52423182 sy_chen A April 6, 2019, 6:03 p.m. OK PyPy 2 TESTS 79 171 17203200 1100
52443617 Claustrophobic_Penguin A April 7, 2019, 7:14 a.m. OK PyPy 2 TESTS 79 171 17305600 1100
52388908 frederika A April 6, 2019, 11:48 a.m. OK PyPy 2 TESTS 79 186 18329600 1100
52418396 allonsy_kim A April 6, 2019, 4:03 p.m. OK PyPy 2 TESTS 79 186 18329600 1100
52388002 wangkan2001 A April 6, 2019, 11:45 a.m. OK PyPy 2 TESTS 79 187 17305600 1100
52388211 raj1307 A April 6, 2019, 11:46 a.m. OK PyPy 2 TESTS 79 187 21606400 1100
52469118 pajenegod A April 7, 2019, 5:30 p.m. OK PyPy 2 TESTS 79 187 21811200 1100
52478084 pajenegod A April 8, 2019, 2:06 a.m. OK PyPy 3 TESTS 79 187 25702400 1100
52469614 pajenegod A April 7, 2019, 5:45 p.m. OK PyPy 3 TESTS 79 218 25088000 1100
52427409 LordVoldebug A April 6, 2019, 8 p.m. OK PyPy 3 TESTS 79 233 19660800 1100
52598276 pajenegod A April 11, 2019, 10:31 a.m. OK PyPy 3 TESTS 79 233 25804800 1100
52512559 pajenegod A April 9, 2019, 1:15 a.m. OK PyPy 3 TESTS 79 233 26112000 1100
52608074 pajenegod A April 11, 2019, 2:44 p.m. OK PyPy 3 TESTS 79 233 26316800 1100
52607532 pajenegod A April 11, 2019, 2:29 p.m. OK PyPy 3 TESTS 79 233 26316800 1100
52512551 pajenegod A April 9, 2019, 1:15 a.m. OK PyPy 3 TESTS 79 234 25804800 1100
52597579 pajenegod A April 11, 2019, 10:02 a.m. OK PyPy 3 TESTS 79 249 25702400 1100
53388407 tuwuna A April 27, 2019, 5:28 a.m. OK PyPy 3 TESTS 79 249 26214400 1100
52653739 l_anna A April 12, 2019, 5:48 p.m. OK Python 2 TESTS 79 218 14540800 1100
52401234 deecoder A April 6, 2019, 12:33 p.m. OK Python 2 TESTS 79 249 14848000 1100
58840698 rodrigo20_95 A Aug. 15, 2019, 1:50 a.m. OK Python 2 TESTS 79 296 16384000 1100
53008267 tbhuu A April 19, 2019, 10:45 a.m. OK Python 2 TESTS 79 311 16076800 1100
54822776 franckmy A May 30, 2019, 4:27 a.m. OK Python 2 TESTS 79 311 16179200 1100
52455971 Revenant_ A April 7, 2019, 11:45 a.m. OK Python 2 TESTS 79 311 16384000 1100
54916983 kpiiitb A June 1, 2019, 2:24 p.m. OK Python 2 TESTS 79 327 16076800 1100
52422772 eugalt A April 6, 2019, 5:51 p.m. OK Python 2 TESTS 79 327 16076800 1100
52417578 Helli.code A April 6, 2019, 3:42 p.m. OK Python 2 TESTS 79 327 16076800 1100
52399882 Rafelaa A April 6, 2019, 12:26 p.m. OK Python 2 TESTS 79 327 16384000 1100
52573702 Lunatch A April 10, 2019, 3:21 p.m. OK Python 3 TESTS 79 155 15769600 1100
52483456 xiaoshizhan A April 8, 2019, 7:18 a.m. OK Python 3 TESTS 79 171 15667200 1100
52432584 eugalt A April 7, 2019, 12:37 a.m. OK Python 3 TESTS 79 171 15872000 1100
69568855 cs1g A Jan. 26, 2020, 1:25 p.m. OK Python 3 TESTS 79 171 16281600 1100
52549539 d_shiladityab24 A April 10, 2019, 2:30 a.m. OK Python 3 TESTS 79 186 16281600 1100
52431381 HydraulicSheep A April 6, 2019, 11:15 p.m. OK Python 3 TESTS 79 187 15974400 1100
52640421 toperper11 A April 12, 2019, 12:13 p.m. OK Python 3 TESTS 79 202 15667200 1100
52618179 dynamicMaiden A April 11, 2019, 7:41 p.m. OK Python 3 TESTS 79 202 15667200 1100
52438850 eugalt A April 7, 2019, 5:34 a.m. OK Python 3 TESTS 79 202 15667200 1100
55407294 somnath796 A June 10, 2019, 5:19 p.m. OK Python 3 TESTS 79 202 15872000 1100
52389536 simanman A April 6, 2019, 11:49 a.m. OK Ruby TESTS 79 265 21299200 1100
52389783 rinzu A April 6, 2019, 11:50 a.m. OK Ruby TESTS 79 280 21299200 1100
52600060 Dx18 A April 11, 2019, 11:29 a.m. OK Rust TESTS 79 46 6758400 1100
52673172 jedikni A April 13, 2019, 8:24 a.m. OK Scala TESTS 79 498 26112000 1100
52389893 yakamoto A April 6, 2019, 11:50 a.m. OK Scala TESTS 79 545 8499200 1100
52543812 PLUkraine A April 9, 2019, 7:45 p.m. OK Scala TESTS 79 545 29593600 1100
52604764 Geralt_Of_Rivia A April 11, 2019, 1:26 p.m. OK Scala TESTS 79 607 33894400 1100

remove filters

Back to search problems