Codeforces Round 959 sponsored by NEAR (Div. 1 + 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
1994 Codeforces Round 959 sponsored by NEAR (Div. 1 + Div. 2) FINISHED False 7200 10509899 July 18, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 16526 ) B Fun Game PROGRAMMING bitmasks constructive algorithms greedy math

B'Vova really loves the XOR operation (denoted as oplus ). Recently, when he was going to sleep, he came up with a fun game. At the beginning of the game, Vova chooses two binary sequences s and t of length n and gives them to Vanya. A binary sequence is a sequence consisting only of the numbers 0 and 1 . Vanya can choose integers l, r such that 1 <= q l <= q r <= q n , and for all l <= q i <= q r simultaneously replace s_i with s_i oplus s_{i - l + 1} , where s_i is the i -th element of the sequence s . In order for the game to be interesting, there must be a possibility to win. Vanya wins if, with an unlimited number of actions, he can obtain the sequence t from the sequence s . Determine if the game will be interesting for the sequences s and t . Each test consists of multiple test cases. The first line contains an integer q ( 1 <= q <= 10^{4} ) -- the number of test cases. Then follows the description of the test cases. The first line of each test case contains a single integer n ( 1 <= q n <= q 2 cdot 10^5 ) -- the length of the sequences s and t . The second line of each test case contains a binary sequence s of length n . The third line of each test case contains a binary sequence t of length n . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output "Yes" if the game will be interesting, otherwise output "No". You can output each letter in any case (for example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as a positive answer). In the first test case, Vanya will not be able to change the sequence s with the only possible action of choosing l = r = 1 . In the second test case, the sequences s and t are already equal. In the third test case, Vanya can act as follows: '...

Tutorials

Video Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
271258153 ayushsinghbharti B July 18, 2024, 4:20 p.m. OK C# 10 TESTS 10 108 1638400
271312788 Abhay_Sharma B July 19, 2024, 2:55 a.m. OK C++14 (GCC 6-32) TESTS 11 46 0
271309855 wwwsddyy B July 19, 2024, 2:26 a.m. OK C++14 (GCC 6-32) TESTS 11 46 0
271301242 Cras0432 B July 19, 2024, 12:35 a.m. OK C++14 (GCC 6-32) TESTS 11 46 0
271299475 Rombing B July 19, 2024, 12:02 a.m. OK C++14 (GCC 6-32) TESTS 11 46 0
271282049 issol B July 18, 2024, 7:24 p.m. OK C++14 (GCC 6-32) TESTS 11 46 0
271281288 sambodhi7 B July 18, 2024, 7:16 p.m. OK C++14 (GCC 6-32) TESTS 11 46 0
271271732 ProgCroco B July 18, 2024, 5:48 p.m. OK C++14 (GCC 6-32) TESTS 11 46 0
271304147 beacon_cwk B July 19, 2024, 1:19 a.m. OK C++14 (GCC 6-32) TESTS 11 46 409600
271302736 hou521 B July 19, 2024, 1 a.m. OK C++14 (GCC 6-32) TESTS 11 46 409600
271312023 CChenLei B July 19, 2024, 2:48 a.m. OK C++14 (GCC 6-32) TESTS 11 46 1638400
271298184 FranJ B July 18, 2024, 11:31 p.m. OK C++17 (GCC 7-32) TESTS 11 31 819200
271329362 humblefoo1 B July 19, 2024, 5:53 a.m. OK C++17 (GCC 7-32) TESTS 12 46 0
271328842 spampots B July 19, 2024, 5:48 a.m. OK C++17 (GCC 7-32) TESTS 12 46 0
271327875 Wind_Flute B July 19, 2024, 5:38 a.m. OK C++17 (GCC 7-32) TESTS 12 46 0
271327198 sahil_beck B July 19, 2024, 5:32 a.m. OK C++17 (GCC 7-32) TESTS 12 46 0
271326608 abhinav139 B July 19, 2024, 5:26 a.m. OK C++17 (GCC 7-32) TESTS 12 46 0
271325712 aryangoyal_01 B July 19, 2024, 5:15 a.m. OK C++17 (GCC 7-32) TESTS 11 46 0
271325058 solankinilam42 B July 19, 2024, 5:08 a.m. OK C++17 (GCC 7-32) TESTS 11 46 0
271324992 gagan_4656 B July 19, 2024, 5:07 a.m. OK C++17 (GCC 7-32) TESTS 11 46 0
271324931 gaganbacademics6 B July 19, 2024, 5:06 a.m. OK C++17 (GCC 7-32) TESTS 11 46 0
271330441 nirmal_9_9 B July 19, 2024, 6:03 a.m. OK C++20 (GCC 13-64) TESTS 12 46 0
271330404 ayush_1801 B July 19, 2024, 6:02 a.m. OK C++20 (GCC 13-64) TESTS 12 46 0
271329282 foundnt_Alice B July 19, 2024, 5:52 a.m. OK C++20 (GCC 13-64) TESTS 12 46 0
271327350 damon109 B July 19, 2024, 5:34 a.m. OK C++20 (GCC 13-64) TESTS 12 46 0
271327331 Aaditya_king B July 19, 2024, 5:33 a.m. OK C++20 (GCC 13-64) TESTS 12 46 0
271327008 Nishanth48 B July 19, 2024, 5:30 a.m. OK C++20 (GCC 13-64) TESTS 12 46 0
271326588 venkateshnaik B July 19, 2024, 5:26 a.m. OK C++20 (GCC 13-64) TESTS 12 46 0
271326513 its__pujit B July 19, 2024, 5:25 a.m. OK C++20 (GCC 13-64) TESTS 12 46 0
271326484 whilst_somebody B July 19, 2024, 5:24 a.m. OK C++20 (GCC 13-64) TESTS 12 46 0
271325887 fengzi_ B July 19, 2024, 5:17 a.m. OK C++20 (GCC 13-64) TESTS 11 46 0
271258092 snowball27 B July 18, 2024, 4:20 p.m. OK GNU C11 TESTS 10 77 307200
271261171 yuhangliu1224 B July 18, 2024, 4:28 p.m. OK Go TESTS 10 78 2867200
271301435 1936557 B July 19, 2024, 12:39 a.m. OK Haskell TESTS 11 93 7372800
271284544 ankush9140 B July 18, 2024, 7:53 p.m. OK Java 21 TESTS 11 233 512000
271277124 kunalraj8051 B July 18, 2024, 6:32 p.m. OK Java 21 TESTS 11 234 716800
271330728 Aayush_Rana_ B July 19, 2024, 6:05 a.m. OK Java 21 TESTS 12 249 819200
271286139 Momoi-chan B July 18, 2024, 8:11 p.m. OK Java 21 TESTS 11 249 819200
271274281 powervic08 B July 18, 2024, 6:08 p.m. OK Java 21 TESTS 11 265 512000
271257944 dipesh1203 B July 18, 2024, 4:20 p.m. OK Java 21 TESTS 10 265 512000
271327913 aspgarv112 B July 19, 2024, 5:39 a.m. OK Java 21 TESTS 12 265 716800
271275686 rj3377295 B July 18, 2024, 6:20 p.m. OK Java 21 TESTS 11 265 1843200
271274174 MuniMahesh B July 18, 2024, 6:07 p.m. OK Java 21 TESTS 11 281 1228800
271295220 shivamCode B July 18, 2024, 10:26 p.m. OK Java 21 TESTS 11 296 614400
271324087 wooju.shi B July 19, 2024, 4:57 a.m. OK Java 8 TESTS 11 139 0
271281395 Yousef_Badr B July 18, 2024, 7:17 p.m. OK Java 8 TESTS 11 140 0
271320601 kasinathan_sj B July 19, 2024, 4:11 a.m. OK Java 8 TESTS 11 155 0
271269946 suraj1771singh B July 18, 2024, 5:36 p.m. OK Java 8 TESTS 11 155 0
271261723 faresbadr316 B July 18, 2024, 4:30 p.m. OK Java 8 TESTS 10 156 0
271269517 CipherSphinx_Raj B July 18, 2024, 5:33 p.m. OK Java 8 TESTS 11 171 39219200
271315965 samuelX159 B July 19, 2024, 3:26 a.m. OK Java 8 TESTS 11 186 0
271278700 KaranKamath B July 18, 2024, 6:48 p.m. OK Java 8 TESTS 11 186 0
271261235 2210040117om B July 18, 2024, 4:28 p.m. OK Java 8 TESTS 10 202 0
271277363 Sumitsingh7 B July 18, 2024, 6:34 p.m. OK Java 8 TESTS 11 202 6656000
271255902 filliones B July 18, 2024, 4:14 p.m. OK Kotlin 1.7 TESTS 10 624 86016000
271280439 Alex_Toppo_06 B July 18, 2024, 7:07 p.m. OK Kotlin 1.9 TESTS 11 186 0
271256651 bawal B July 18, 2024, 4:16 p.m. OK PHP TESTS 10 124 27340800
271273284 kanish217 B July 18, 2024, 6 p.m. OK PyPy 3 TESTS 11 233 6758400
271259293 udayan8 B July 18, 2024, 4:23 p.m. OK PyPy 3 TESTS 10 265 16076800
271280262 gerogeVT B July 18, 2024, 7:05 p.m. OK PyPy 3 TESTS 11 296 7475200
271271498 gh0ul__ B July 18, 2024, 5:47 p.m. OK PyPy 3 TESTS 11 311 11161600
271263314 nitesh23356 B July 18, 2024, 4:33 p.m. OK PyPy 3 TESTS 10 327 9216000
271303000 Giantpanda B July 19, 2024, 1:04 a.m. OK PyPy 3 TESTS 11 343 9420800
271254904 plant_trees B July 18, 2024, 4:11 p.m. OK PyPy 3-64 TESTS 10 93 3993600
271259316 _Rajat26 B July 18, 2024, 4:23 p.m. OK PyPy 3-64 TESTS 10 93 4300800
271268374 Om_Singh_ B July 18, 2024, 5:26 p.m. OK PyPy 3-64 TESTS 11 93 5222400
271327569 master_JD B July 19, 2024, 5:35 a.m. OK PyPy 3-64 TESTS 12 124 4505600
271292510 deni1000 B July 18, 2024, 9:39 p.m. OK PyPy 3-64 TESTS 11 124 4812800
271302517 mikeac B July 19, 2024, 12:57 a.m. OK PyPy 3-64 TESTS 11 124 5120000
271280657 viratkalshan B July 18, 2024, 7:09 p.m. OK PyPy 3-64 TESTS 11 124 5222400
271272371 028 B July 18, 2024, 5:53 p.m. OK PyPy 3-64 TESTS 11 125 5120000
271262555 Horse-chan B July 18, 2024, 4:31 p.m. OK PyPy 3-64 TESTS 10 140 3891200
271257096 Ghammaz_SundarSTEM B July 18, 2024, 4:17 p.m. OK PyPy 3-64 TESTS 10 140 4710400
271328403 Ccc3219 B July 19, 2024, 5:44 a.m. OK Python 3 TESTS 12 78 409600
271291157 MTA9402 B July 18, 2024, 9:17 p.m. OK Python 3 TESTS 11 93 1228800
271256741 Glaciel_r B July 18, 2024, 4:16 p.m. OK Python 3 TESTS 10 93 1433600
271255746 ProfessionalPlaigiarizer B July 18, 2024, 4:14 p.m. OK Python 3 TESTS 10 93 1433600
271255206 Vnayak B July 18, 2024, 4:12 p.m. OK Python 3 TESTS 10 93 3584000
271325417 Moiz_Ali B July 19, 2024, 5:12 a.m. OK Python 3 TESTS 11 108 409600
271256170 MidamSri B July 18, 2024, 4:15 p.m. OK Python 3 TESTS 10 108 409600
271324714 M.ZeeshanRashid B July 19, 2024, 5:04 a.m. OK Python 3 TESTS 11 108 6860800
271308852 Inevitable_way B July 19, 2024, 2:15 a.m. OK Python 3 TESTS 11 109 409600
271260181 RatanPrakash B July 18, 2024, 4:26 p.m. OK Python 3 TESTS 10 109 409600
271271532 fieubat2x B July 18, 2024, 5:47 p.m. OK Rust 2021 TESTS 11 62 0

remove filters

Back to search problems