Codeforces Global Round 24

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
1764 Codeforces Global Round 24 FINISHED False 9000 62351699 Nov. 26, 2022, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 16664 ) A Doremy's Paint PROGRAMMING greedy

B'Doremy has n buckets of paint which is represented by an array a of length n . Bucket i contains paint with color a_i . Let c(l,r) be the number of distinct elements in the subarray [a_l,a_{l+1}, ldots,a_r] . Choose 2 integers l and r such that l <= q r and r-l-c(l,r) is maximized. The input consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 10^5 ) -- the length of the array a . The second line of each test case contains n integers a_1,a_2, ldots,a_n ( 1 <= a_i <= n ). It is guaranteed that the sum of n does not exceed 10^5 . For each test case, output l and r such that l <= q r and r-l-c(l,r) is maximized. If there are multiple solutions, you may output any. In the first test case, a=[1,3,2,2,4] . It can be shown that choosing l=2 and r=4 maximizes the value of r-l-c(l,r) at 0 . For the second test case, a=[1,2,3,4,5] . It can be shown that choosing l=1 and r=5 maximizes the value of r-l-c(l,r) at -1 . Choosing l=3 and r=3 is also acceptable. '...

Tutorials

Codeforces Global Round 24 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
182682059 A.Khotoolev A Nov. 26, 2022, 3:16 p.m. OK C# 10 TESTS 14 109 16281600
182678965 ansergeyg A Nov. 26, 2022, 3:05 p.m. OK C# 8 TESTS 14 108 7884800
182729452 MoMo2022 A Nov. 26, 2022, 11:43 p.m. OK Clang++17 Diagnostics TESTS 14 358 3174400
182679486 sanjay77 A Nov. 26, 2022, 3:07 p.m. OK GNU C11 TESTS 14 62 0
182702463 zhenghang A Nov. 26, 2022, 5:04 p.m. OK GNU C11 TESTS 14 62 0
182681257 nforget A Nov. 26, 2022, 3:14 p.m. OK GNU C11 TESTS 14 62 409600
182685021 prox__ A Nov. 26, 2022, 3:28 p.m. OK GNU C11 TESTS 14 62 409600
182685239 awsaf1825 A Nov. 26, 2022, 3:29 p.m. OK GNU C11 TESTS 14 62 409600
182707692 Cloud09 A Nov. 26, 2022, 5:50 p.m. OK GNU C11 TESTS 14 62 409600
182711294 sarfaraza947 A Nov. 26, 2022, 6:24 p.m. OK GNU C11 TESTS 14 62 409600
182680977 __AO__ A Nov. 26, 2022, 3:13 p.m. OK GNU C11 TESTS 14 62 409600
182722413 LazyRGuy A Nov. 26, 2022, 9:04 p.m. OK GNU C11 TESTS 14 62 819200
182688636 Mushfiqur_ A Nov. 26, 2022, 3:44 p.m. OK GNU C11 TESTS 14 78 0
182684213 Mokshit21 A Nov. 26, 2022, 3:25 p.m. OK GNU C++14 TESTS 14 31 0
182678776 NykerStein A Nov. 26, 2022, 3:05 p.m. OK GNU C++14 TESTS 14 31 0
182706350 1346 A Nov. 26, 2022, 5:37 p.m. OK GNU C++14 TESTS 14 31 0
182706556 kaustubh_khanna A Nov. 26, 2022, 5:39 p.m. OK GNU C++14 TESTS 14 31 0
182737874 LYT0122 A Nov. 27, 2022, 4:07 a.m. OK GNU C++14 TESTS 14 31 0
182736895 ShiRoZeTsu A Nov. 27, 2022, 3:43 a.m. OK GNU C++14 TESTS 14 31 0
182734764 Fiatiustitia A Nov. 27, 2022, 2:44 a.m. OK GNU C++14 TESTS 14 31 0
182708474 publio A Nov. 26, 2022, 5:59 p.m. OK GNU C++14 TESTS 14 31 0
182722424 tmamdli A Nov. 26, 2022, 9:05 p.m. OK GNU C++14 TESTS 14 31 0
182690723 Prometeus A Nov. 26, 2022, 3:53 p.m. OK GNU C++14 TESTS 14 31 0
182694885 qrst11 A Nov. 26, 2022, 4:13 p.m. OK GNU C++17 TESTS 14 15 0
182686870 romjan A Nov. 26, 2022, 3:36 p.m. OK GNU C++17 TESTS 14 30 409600
182679347 MILOY A Nov. 26, 2022, 3:07 p.m. OK GNU C++17 TESTS 14 30 1638400
182734484 fugaku A Nov. 27, 2022, 2:35 a.m. OK GNU C++17 TESTS 14 31 0
182741184 Nondifferentiable A Nov. 27, 2022, 5:18 a.m. OK GNU C++17 TESTS 14 31 0
182740502 tcode_2 A Nov. 27, 2022, 5:05 a.m. OK GNU C++17 TESTS 14 31 0
182734694 Lunasama A Nov. 27, 2022, 2:41 a.m. OK GNU C++17 TESTS 14 31 0
182741672 Vxrtesh A Nov. 27, 2022, 5:26 a.m. OK GNU C++17 TESTS 14 31 0
182741630 LanYan A Nov. 27, 2022, 5:25 a.m. OK GNU C++17 TESTS 14 31 0
182741560 Sahilcf_17 A Nov. 27, 2022, 5:24 a.m. OK GNU C++17 TESTS 14 31 0
182705040 donald_duck123 A Nov. 26, 2022, 5:25 p.m. OK GNU C++17 (64) TESTS 14 15 0
182722035 wrc A Nov. 26, 2022, 8:57 p.m. OK GNU C++17 (64) TESTS 14 30 0
182680504 codingmike A Nov. 26, 2022, 3:11 p.m. OK GNU C++17 (64) TESTS 14 30 819200
182703779 whatisthis132 A Nov. 26, 2022, 5:14 p.m. OK GNU C++17 (64) TESTS 14 31 0
182740857 KryptonAu A Nov. 27, 2022, 5:11 a.m. OK GNU C++17 (64) TESTS 14 31 0
182725873 over_flow A Nov. 26, 2022, 10:10 p.m. OK GNU C++17 (64) TESTS 14 31 0
182724572 Ayalla A Nov. 26, 2022, 9:44 p.m. OK GNU C++17 (64) TESTS 14 31 0
182709656 osamaBelal A Nov. 26, 2022, 6:08 p.m. OK GNU C++17 (64) TESTS 14 31 0
182704702 bilasislam5643 A Nov. 26, 2022, 5:22 p.m. OK GNU C++17 (64) TESTS 14 31 0
182703730 whatisthis132 A Nov. 26, 2022, 5:14 p.m. OK GNU C++17 (64) TESTS 14 31 0
182735815 GUSSURI A Nov. 27, 2022, 3:14 a.m. OK GNU C++20 (64) TESTS 14 15 0
182708850 vamos_abhinav A Nov. 26, 2022, 6:03 p.m. OK GNU C++20 (64) TESTS 14 15 0
182718479 Me_Tal A Nov. 26, 2022, 7:59 p.m. OK GNU C++20 (64) TESTS 14 15 409600
182702283 hngara A Nov. 26, 2022, 5:03 p.m. OK GNU C++20 (64) TESTS 14 15 409600
182704972 MeetSutariya A Nov. 26, 2022, 5:24 p.m. OK GNU C++20 (64) TESTS 14 15 409600
182735517 Lukman03 A Nov. 27, 2022, 3:05 a.m. OK GNU C++20 (64) TESTS 14 15 409600
182740139 Mohamed_Sawy A Nov. 27, 2022, 4:58 a.m. OK GNU C++20 (64) TESTS 14 15 409600
182707090 figmaOld A Nov. 26, 2022, 5:44 p.m. OK GNU C++20 (64) TESTS 14 15 819200
182705103 Eman_Moh A Nov. 26, 2022, 5:26 p.m. OK GNU C++20 (64) TESTS 14 15 819200
182715003 WannaCry00 A Nov. 26, 2022, 7:08 p.m. OK GNU C++20 (64) TESTS 14 15 1228800
182680259 _shrish_ A Nov. 26, 2022, 3:10 p.m. OK Go TESTS 14 62 1638400
182714141 TomazGomes A Nov. 26, 2022, 6:57 p.m. OK Haskell TESTS 14 171 23142400
182739077 ketangupta12 A Nov. 27, 2022, 4:35 a.m. OK Java 11 TESTS 14 186 0
182740018 sf14t A Nov. 27, 2022, 4:56 a.m. OK Java 11 TESTS 14 202 0
182725619 Yousef_Badr A Nov. 26, 2022, 10:04 p.m. OK Java 11 TESTS 14 217 0
182694827 procrastinate7 A Nov. 26, 2022, 4:13 p.m. OK Java 11 TESTS 14 218 0
182680247 sduMamutbekov A Nov. 26, 2022, 3:10 p.m. OK Java 11 TESTS 14 234 0
182709635 bajpaisharanya A Nov. 26, 2022, 6:07 p.m. OK Java 11 TESTS 14 280 0
182707697 mcrash12 A Nov. 26, 2022, 5:50 p.m. OK Java 11 TESTS 14 280 0
182701991 SAY_NO_TO_EDITORIAL A Nov. 26, 2022, 5:02 p.m. OK Java 11 TESTS 14 296 0
182684970 vishwajeet.singh.me23 A Nov. 26, 2022, 3:28 p.m. OK Java 11 TESTS 14 296 0
182703961 Leenelmir A Nov. 26, 2022, 5:16 p.m. OK Java 11 TESTS 14 312 0
182705497 Thejas_n A Nov. 26, 2022, 5:29 p.m. OK Java 17 TESTS 14 234 0
182703871 YocyCraft A Nov. 26, 2022, 5:15 p.m. OK Java 17 TESTS 14 249 921600
182682840 Grizler A Nov. 26, 2022, 3:19 p.m. OK Java 17 TESTS 14 280 204800
182725205 bhandarisourabhrahul A Nov. 26, 2022, 9:56 p.m. OK Java 17 TESTS 14 280 409600
182702382 tbs-jyy A Nov. 26, 2022, 5:04 p.m. OK Java 17 TESTS 14 280 614400
182693195 Don_Haitham A Nov. 26, 2022, 4:05 p.m. OK Java 17 TESTS 14 343 204800
182682499 AIZEN2000 A Nov. 26, 2022, 3:18 p.m. OK Java 17 TESTS 14 389 1433600
182713533 max. A Nov. 26, 2022, 6:50 p.m. OK Java 17 TESTS 14 405 716800
182706066 Abhinav__hadole A Nov. 26, 2022, 5:34 p.m. OK Java 17 TESTS 14 405 921600
182683616 diveshmahajan A Nov. 26, 2022, 3:22 p.m. OK Java 17 TESTS 14 420 614400
182707390 Sussykin A Nov. 26, 2022, 5:47 p.m. OK Java 8 TESTS 14 108 0
182704984 Eslam_Ahmed A Nov. 26, 2022, 5:25 p.m. OK Java 8 TESTS 14 109 0
182692787 CPTN_LTE A Nov. 26, 2022, 4:03 p.m. OK Java 8 TESTS 14 109 0
182715629 Kheder_YSF A Nov. 26, 2022, 7:16 p.m. OK Java 8 TESTS 14 124 0
182702465 Koka A Nov. 26, 2022, 5:04 p.m. OK Java 8 TESTS 14 124 0
182705345 yadavdipesh A Nov. 26, 2022, 5:28 p.m. OK Java 8 TESTS 14 170 4812800
182733088 iamJatinYadav A Nov. 27, 2022, 1:54 a.m. OK Java 8 TESTS 14 202 0
182704149 toufique_husein A Nov. 26, 2022, 5:17 p.m. OK Java 8 TESTS 14 233 0
182680933 vis21 A Nov. 26, 2022, 3:12 p.m. OK Java 8 TESTS 14 233 0
182690426 toddliu26 A Nov. 26, 2022, 3:52 p.m. OK Java 8 TESTS 14 249 0
182708750 Kay0 A Nov. 26, 2022, 6:02 p.m. OK Kotlin 1.6 TESTS 14 280 0
182703361 Krantzy A Nov. 26, 2022, 5:11 p.m. OK Kotlin 1.7 TESTS 14 514 37990400
182682472 v4_adi A Nov. 26, 2022, 3:18 p.m. OK Kotlin 1.7 TESTS 14 624 39321600
182678547 Mikhail1928 A Nov. 26, 2022, 3:04 p.m. OK MS C++ 2017 TESTS 14 93 409600
182683212 qtx_yml A Nov. 26, 2022, 3:21 p.m. OK MS C++ 2017 TESTS 14 108 409600
182682323 Devil_from_hell A Nov. 26, 2022, 3:17 p.m. OK MS C++ 2017 TESTS 14 124 409600
182730550 hua_yi_jiu A Nov. 27, 2022, 12:23 a.m. OK MS C++ 2017 TESTS 14 124 3993600
182692372 bebra_parkur228killer777 A Nov. 26, 2022, 4:01 p.m. OK MS C++ 2017 TESTS 14 140 82841600
182712825 sw_enthusiast A Nov. 26, 2022, 6:41 p.m. OK PyPy 3 TESTS 14 171 76083200
182688448 pavel_vol A Nov. 26, 2022, 3:43 p.m. OK PyPy 3 TESTS 14 295 7987200
182688550 TaPo4eK_ A Nov. 26, 2022, 3:43 p.m. OK PyPy 3 TESTS 14 373 10342400
182696462 egor_1054 A Nov. 26, 2022, 4:21 p.m. OK PyPy 3 TESTS 14 374 7065600
182726013 WalrusRamen21 A Nov. 26, 2022, 10:13 p.m. OK PyPy 3 TESTS 14 374 8601600
182679922 NicholasTing A Nov. 26, 2022, 3:09 p.m. OK PyPy 3 TESTS 14 389 8908800
182722490 ArtemiiP A Nov. 26, 2022, 9:06 p.m. OK PyPy 3 TESTS 14 389 10342400
182679300 _gajera__28_0 A Nov. 26, 2022, 3:06 p.m. OK PyPy 3 TESTS 14 420 10547200
182702279 mguliyev12360 A Nov. 26, 2022, 5:03 p.m. OK PyPy 3 TESTS 14 421 10547200
182737685 bpdolson A Nov. 27, 2022, 4:03 a.m. OK PyPy 3 TESTS 14 436 10342400
182713530 Trem0r A Nov. 26, 2022, 6:50 p.m. OK PyPy 3-64 TESTS 14 93 6758400
182681109 the_last_smilodon A Nov. 26, 2022, 3:13 p.m. OK PyPy 3-64 TESTS 14 93 7065600
182712857 Trem0r A Nov. 26, 2022, 6:42 p.m. OK PyPy 3-64 TESTS 14 93 13926400
182723250 _tb A Nov. 26, 2022, 9:20 p.m. OK PyPy 3-64 TESTS 14 108 6041600
182727878 biglunchdude A Nov. 26, 2022, 10:56 p.m. OK PyPy 3-64 TESTS 14 108 14028800
182704036 nealzane A Nov. 26, 2022, 5:16 p.m. OK PyPy 3-64 TESTS 14 109 13619200
182706055 govindp47 A Nov. 26, 2022, 5:34 p.m. OK PyPy 3-64 TESTS 14 124 13312000
182692448 ProblemA_is_DP A Nov. 26, 2022, 4:01 p.m. OK PyPy 3-64 TESTS 14 124 13721600
182733816 rien A Nov. 27, 2022, 2:16 a.m. OK PyPy 3-64 TESTS 14 124 14131200
182706504 mintplz A Nov. 26, 2022, 5:38 p.m. OK PyPy 3-64 TESTS 14 124 14131200
182683115 xph_4n A Nov. 26, 2022, 3:20 p.m. OK Python 2 TESTS 14 62 1126400
182719474 eugalt A Nov. 26, 2022, 8:15 p.m. OK Python 3 TESTS 14 62 921600
182731034 MohaSa A Nov. 27, 2022, 12:43 a.m. OK Python 3 TESTS 14 62 1024000
182702277 chelek A Nov. 26, 2022, 5:03 p.m. OK Python 3 TESTS 14 77 921600
182687428 M-ANEEQ A Nov. 26, 2022, 3:38 p.m. OK Python 3 TESTS 14 77 5120000
182679622 eugalt A Nov. 26, 2022, 3:08 p.m. OK Python 3 TESTS 14 78 5222400
182687887 longvb48 A Nov. 26, 2022, 3:40 p.m. OK Python 3 TESTS 14 78 6963200
182682451 Musmo A Nov. 26, 2022, 3:18 p.m. OK Python 3 TESTS 14 93 6963200
182686735 Har.Preet.Singh A Nov. 26, 2022, 3:35 p.m. OK Python 3 TESTS 14 124 1638400
182714757 newbda A Nov. 26, 2022, 7:04 p.m. OK Python 3 TESTS 14 124 5529600
182734094 a_shik_ A Nov. 27, 2022, 2:24 a.m. OK Python 3 TESTS 14 139 1638400
182731883 Spheniscine A Nov. 27, 2022, 1:12 a.m. OK Rust 2021 TESTS 14 15 2150400

remove filters

Back to search problems