Codeforces Round 881 (Div. 3)

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
1843 Codeforces Round 881 (Div. 3) FINISHED False 8100 49994663 June 20, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13180 ) E Tracking Segments PROGRAMMING binary search

B"You are given an array a consisting of n zeros. You are also given a set of m not necessarily different segments. Each segment is defined by two numbers l_i and r_i ( 1 <= l_i <= r_i <= n ) and represents a subarray a_{l_i}, a_{l_i+1}, ... , a_{r_i} of the array a . Let's call the segment l_i, r_i beautiful if the number of ones on this segment is strictly greater than the number of zeros. For example, if a = [1, 0, 1, 0, 1] , then the segment [1, 5] is beautiful (the number of ones is 3 , the number of zeros is 2 ), but the segment [3, 4] is not is beautiful (the number of ones is 1 , the number of zeros is 1 ). You also have q changes. For each change you are given the number 1 <= x <= n , which means that you must assign an element a_x the value 1 . You have to find the first change after which at least one of m given segments becomes beautiful, or report that none of them is beautiful after processing all q changes. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains two integers n and m ( 1 <= m <= n <= 10^5 ) -- the size of the array a and the number of segments, respectively. Then there are m lines consisting of two numbers l_i and r_i ( 1 <= l_i <= r_i <= n ) --the boundaries of the segments. The next line contains an integer q ( 1 <= q <= n ) -- the number of changes. The following q lines each contain a single integer x ( 1 <= x <= n ) -- the index of the array element that needs to be set to 1 . It is guaranteed that indexes in queries are distinct. It is guaranteed that the sum of n for all test cases does not exceed 10^5 . For each test case, output one integer -- the minimum change number after which at least one of th"...

Tutorials

Codeforces Round #881 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
210540994 q2045891621. E June 21, 2023, 11:49 a.m. OK Clang++17 Diagnostics TESTS 22 1543 8908800
210493502 zltzlt E June 21, 2023, 12:55 a.m. OK GNU C++14 TESTS 22 62 1638400
210551995 HuskieQAQ E June 21, 2023, 1:34 p.m. OK GNU C++14 TESTS 22 62 2048000
210504231 wifi32767 E June 21, 2023, 4:39 a.m. OK GNU C++14 TESTS 22 62 3174400
210606220 Rawan_Almashad E June 22, 2023, 1:37 a.m. OK GNU C++14 TESTS 22 78 1638400
210521109 manavdhiman003 E June 21, 2023, 8:31 a.m. OK GNU C++14 TESTS 22 78 1638400
210496104 phannguyenquocbao E June 21, 2023, 2:03 a.m. OK GNU C++14 TESTS 22 78 1638400
210553107 vaibhav066 E June 21, 2023, 1:45 p.m. OK GNU C++14 TESTS 22 78 1843200
210510274 lmf_up E June 21, 2023, 6:24 a.m. OK GNU C++14 TESTS 22 78 1945600
210618897 Je3ter E June 22, 2023, 5:23 a.m. OK GNU C++14 TESTS 22 78 2048000
210602435 Roballeron E June 22, 2023, 12:14 a.m. OK GNU C++14 TESTS 22 78 2457600
210567387 slim-doggy E June 21, 2023, 3:59 p.m. OK GNU C++17 TESTS 22 62 2048000
210506099 love94610 E June 21, 2023, 5:14 a.m. OK GNU C++17 TESTS 22 62 2252800
210546915 -----as E June 21, 2023, 12:46 p.m. OK GNU C++17 TESTS 22 77 1638400
210511923 Firefly1210 E June 21, 2023, 6:54 a.m. OK GNU C++17 TESTS 22 77 1638400
210503321 A_C_boy E June 21, 2023, 4:22 a.m. OK GNU C++17 TESTS 22 77 1638400
210578347 kevinz20 E June 21, 2023, 5:55 p.m. OK GNU C++17 TESTS 22 77 1843200
210567319 slim-doggy E June 21, 2023, 3:59 p.m. OK GNU C++17 TESTS 22 77 2048000
210547407 rohitrathod_98 E June 21, 2023, 12:51 p.m. OK GNU C++17 TESTS 22 77 2457600
210496175 M.GhulamMohiuddin E June 21, 2023, 2:04 a.m. OK GNU C++17 TESTS 22 77 2560000
210508639 chakradhar94 E June 21, 2023, 5:54 a.m. OK GNU C++17 TESTS 22 77 3788800
210581491 _Yeager_ E June 21, 2023, 6:33 p.m. OK GNU C++17 (64) TESTS 22 46 1638400
210495625 EotUL8d7 E June 21, 2023, 1:51 a.m. OK GNU C++17 (64) TESTS 22 46 1638400
210552996 Topperoo E June 21, 2023, 1:44 p.m. OK GNU C++17 (64) TESTS 22 46 2457600
210507184 Eman_Nasser E June 21, 2023, 5:31 a.m. OK GNU C++17 (64) TESTS 22 46 6144000
210546940 yrtrt E June 21, 2023, 12:47 p.m. OK GNU C++17 (64) TESTS 22 46 13107200
210535649 3m_ur E June 21, 2023, 10:55 a.m. OK GNU C++17 (64) TESTS 22 61 1638400
210607627 struggl3r E June 22, 2023, 2:04 a.m. OK GNU C++17 (64) TESTS 22 61 2150400
210566310 Tanphoon E June 21, 2023, 3:49 p.m. OK GNU C++17 (64) TESTS 22 62 1638400
210520478 mas2alt_wa2t E June 21, 2023, 8:25 a.m. OK GNU C++17 (64) TESTS 22 62 1638400
210497390 Once_I_Liked_AGirl E June 21, 2023, 2:30 a.m. OK GNU C++17 (64) TESTS 22 62 1638400
210620429 moyegege E June 22, 2023, 5:48 a.m. OK GNU C++20 (64) TESTS 22 46 1638400
210611296 wa_maker E June 22, 2023, 3:15 a.m. OK GNU C++20 (64) TESTS 22 46 1638400
210605368 bipartite E June 22, 2023, 1:20 a.m. OK GNU C++20 (64) TESTS 22 46 1638400
210605297 hcywoi E June 22, 2023, 1:19 a.m. OK GNU C++20 (64) TESTS 22 46 1638400
210604951 emn2 E June 22, 2023, 1:11 a.m. OK GNU C++20 (64) TESTS 22 46 1638400
210604809 shahpppp E June 22, 2023, 1:08 a.m. OK GNU C++20 (64) TESTS 22 46 1638400
210599450 afaf.rafat77 E June 21, 2023, 11:06 p.m. OK GNU C++20 (64) TESTS 22 46 1638400
210598865 Fofa77 E June 21, 2023, 10:54 p.m. OK GNU C++20 (64) TESTS 22 46 1638400
210598501 qaruti E June 21, 2023, 10:48 p.m. OK GNU C++20 (64) TESTS 22 46 1638400
210596149 Lion_Heart E June 21, 2023, 10:03 p.m. OK GNU C++20 (64) TESTS 22 46 1638400
210566115 DATVN E June 21, 2023, 3:47 p.m. OK Go TESTS 22 124 7577600
210496112 0x3F E June 21, 2023, 2:03 a.m. OK Go TESTS 22 124 7680000
210495907 0x3F E June 21, 2023, 1:58 a.m. OK Go TESTS 22 124 7680000
210500226 cill E June 21, 2023, 3:25 a.m. OK Go TESTS 22 140 7884800
210505760 ilasiawo E June 21, 2023, 5:08 a.m. OK Java 11 TESTS 22 233 0
210498501 lpychemistry E June 21, 2023, 2:52 a.m. OK Java 11 TESTS 22 233 0
210541716 Aniketh_Deshmukh E June 21, 2023, 11:56 a.m. OK Java 11 TESTS 22 248 0
210604596 new2ac E June 22, 2023, 1:04 a.m. OK Java 11 TESTS 22 248 204800
210589124 themadknight45 E June 21, 2023, 8:19 p.m. OK Java 11 TESTS 22 249 0
210539144 q2045891621. E June 21, 2023, 11:30 a.m. OK Java 11 TESTS 22 249 0
210497914 aditya_2024 E June 21, 2023, 2:41 a.m. OK Java 11 TESTS 22 436 0
210572653 devansh_123 E June 21, 2023, 4:52 p.m. OK Java 11 TESTS 22 546 0
210542520 soumit915 E June 21, 2023, 12:05 p.m. OK Java 17 TESTS 22 233 307200
210542725 wintersoldier2004 E June 21, 2023, 12:07 p.m. OK Java 17 TESTS 22 311 409600
210523443 wdjuruo E June 21, 2023, 8:52 a.m. OK Java 17 TESTS 22 311 409600
210615995 cpp10 E June 22, 2023, 4:36 a.m. OK Java 17 TESTS 22 311 512000
210512893 xiaopang003 E June 21, 2023, 7:06 a.m. OK Java 17 TESTS 22 311 2457600
210513097 miminguci E June 21, 2023, 7:08 a.m. OK Java 17 TESTS 22 327 102400
210534818 v_0403 E June 21, 2023, 10:46 a.m. OK Java 17 TESTS 22 327 1945600
210512405 mo_heat E June 21, 2023, 7:01 a.m. OK Java 17 TESTS 22 327 1945600
210496406 HMETAO E June 21, 2023, 2:09 a.m. OK Java 17 TESTS 22 342 614400
210521755 Atlas E June 21, 2023, 8:37 a.m. OK Java 17 TESTS 22 358 1331200
210500442 chuquwan9964 E June 21, 2023, 3:29 a.m. OK Java 8 TESTS 22 139 0
210577500 iamdimonis E June 21, 2023, 5:46 p.m. OK Java 8 TESTS 22 155 0
210609964 Monkey_de_Luffy E June 22, 2023, 2:49 a.m. OK Java 8 TESTS 22 171 0
210562535 Imran435 E June 21, 2023, 3:12 p.m. OK Java 8 TESTS 22 171 0
210561574 Harish_777 E June 21, 2023, 3:03 p.m. OK Java 8 TESTS 22 171 0
210498529 2023_upsolver E June 21, 2023, 2:53 a.m. OK Java 8 TESTS 22 171 0
210501381 magic_kid E June 21, 2023, 3:47 a.m. OK Java 8 TESTS 22 186 0
210499029 aFShahahahxx E June 21, 2023, 3:02 a.m. OK Java 8 TESTS 22 186 0
210589371 sachinjaiswal E June 21, 2023, 8:22 p.m. OK Java 8 TESTS 22 202 0
210611479 lioeva_niuma E June 22, 2023, 3:19 a.m. OK Java 8 TESTS 22 218 0
210562346 ngongocthinh123 E June 21, 2023, 3:11 p.m. OK JavaScript TESTS 22 343 20275200
210543099 linxiaotian E June 21, 2023, 12:10 p.m. OK Kotlin 1.6 TESTS 22 374 14848000
210538206 hartiksalaria E June 21, 2023, 11:21 a.m. OK Kotlin 1.6 TESTS 22 389 10444800
210549549 SlavaG E June 21, 2023, 1:10 p.m. OK Kotlin 1.7 TESTS 22 639 99430400
210550014 SlavaG E June 21, 2023, 1:14 p.m. OK Kotlin 1.7 TESTS 22 670 95846400
210557819 Zahar2008 E June 21, 2023, 2:27 p.m. OK MS C++ 2017 TESTS 22 234 3993600
210620996 kikjeck E June 22, 2023, 5:57 a.m. OK PyPy 3 TESTS 22 405 25190400
210512702 torqueaj E June 21, 2023, 7:04 a.m. OK PyPy 3 TESTS 22 482 26521600
210517759 lol_py E June 21, 2023, 7:59 a.m. OK PyPy 3 TESTS 22 1590 16793600
210601799 EpicChadGamer E June 21, 2023, 11:59 p.m. OK PyPy 3-64 TESTS 22 171 23961600
210614212 vedantmishra69 E June 22, 2023, 4:07 a.m. OK PyPy 3-64 TESTS 22 202 37068800
210502936 mxDawdle E June 21, 2023, 4:15 a.m. OK PyPy 3-64 TESTS 22 233 22528000
210593811 mathiaswk E June 21, 2023, 9:23 p.m. OK PyPy 3-64 TESTS 22 234 41676800
210614257 Raindrops1117 E June 22, 2023, 4:08 a.m. OK PyPy 3-64 TESTS 22 248 22937600
210526872 solitaryReaper E June 21, 2023, 9:25 a.m. OK PyPy 3-64 TESTS 22 249 31129600
210604685 pedrosorio E June 22, 2023, 1:06 a.m. OK PyPy 3-64 TESTS 22 265 37171200
210518886 Mohamed_Hamed E June 21, 2023, 8:09 a.m. OK PyPy 3-64 TESTS 22 265 41881600
210537989 JinYuManTang E June 21, 2023, 11:19 a.m. OK PyPy 3-64 TESTS 22 280 24064000
210580867 saini.laxman2002 E June 21, 2023, 6:25 p.m. OK PyPy 3-64 TESTS 22 295 43417600
210601237 Striver- E June 21, 2023, 11:46 p.m. OK Python 3 TESTS 22 826 26214400
210561785 Alaskan E June 21, 2023, 3:05 p.m. OK Python 3 TESTS 22 826 26214400
210617554 nipungoyal03 E June 22, 2023, 5:01 a.m. OK Python 3 TESTS 22 873 26214400
210548335 xuanwoshiluo E June 21, 2023, 12:59 p.m. OK Python 3 TESTS 22 1013 28160000
210575223 Westin_sheep E June 21, 2023, 5:20 p.m. OK Python 3 TESTS 22 1544 27443200
210539311 Stan_Marsh Kenny__McCormick Thief_Executive_Officer E June 21, 2023, 11:32 a.m. OK Rust 2021 TESTS 22 124 2560000
210520522 codinglyf_07 E June 21, 2023, 8:25 a.m. OK Rust 2021 TESTS 22 124 2560000
210520167 codinglyf_07 E June 21, 2023, 8:22 a.m. OK Rust 2021 TESTS 22 155 2560000

remove filters

Back to search problems