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.
Problems
B"This is the solo version of the problem. Note that the solution of this problem may or may not share ideas with the solution of the game version. You can solve and get points for both versions independently. You can make hacks only if both versions of the problem are solved. Given an integer variable x with the initial value of n . A single break operation consists of the following steps: You don't need to minimize the number of operations. Here oplus denotes the bitwise XOR operation. The first line contains one positive integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Each test case consists of a single line containing two integers n and m ( 1 <= q m lt n <= q 10^{18} ) -- the initial value of x and the target value of x . For each test case, output your answer in the following format. If it is not possible to achieve m in 63 operations, print -1 . Otherwise, The first line should contain k ( 1 <= q k <= q 63 ) -- where k is the number of operations required. The next line should contain k+1 integers -- the sequence where variable x changes after each break operation. The 1 -st and k+1 -th integers should be n and m , respectively. In the first test case n = 7 , for the first operation x = 7 if we choose y = 3 then (7 oplus 3) lt 7 , hence we can update x with 3 which is equal to m . In the second test case n = 4 , for the first operation x = 4 . If we choose: Hence we can't do the first operation and it is impossible to make x = 2 . "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
249185941 |
r1ck.sync |
D1 |
March 1, 2024, 5:55 p.m. |
OK |
GNU C11 |
TESTS |
34 |
124 |
307200 |
|
|
249176057 |
rainboy |
D1 |
March 1, 2024, 5:10 p.m. |
OK |
GNU C11 |
TESTS |
34 |
140 |
307200 |
|
|
249250177 |
Ds110 |
D1 |
March 2, 2024, 5:41 a.m. |
OK |
GNU C++17 |
TESTS |
34 |
31 |
0 |
|
|
249229935 |
EvenToWorldFinal |
D1 |
March 2, 2024, 2:25 a.m. |
OK |
GNU C++17 |
TESTS |
34 |
31 |
0 |
|
|
249227285 |
Amit7777 |
D1 |
March 2, 2024, 1:40 a.m. |
OK |
GNU C++17 |
TESTS |
34 |
31 |
0 |
|
|
249220603 |
mertyilmaz |
D1 |
March 1, 2024, 11:20 p.m. |
OK |
GNU C++17 |
TESTS |
34 |
31 |
0 |
|
|
249210518 |
_Z0R0_ |
D1 |
March 1, 2024, 8:54 p.m. |
OK |
GNU C++17 |
TESTS |
34 |
31 |
0 |
|
|
249199423 |
harryb17 |
D1 |
March 1, 2024, 7:19 p.m. |
OK |
GNU C++17 |
TESTS |
34 |
31 |
0 |
|
|
249234708 |
Actium |
D1 |
March 2, 2024, 3:23 a.m. |
OK |
GNU C++17 |
TESTS |
34 |
31 |
0 |
|
|
249234061 |
PanSPW |
D1 |
March 2, 2024, 3:17 a.m. |
OK |
GNU C++17 |
TESTS |
34 |
31 |
0 |
|
|
249245392 |
Rhyme3 |
D1 |
March 2, 2024, 5:05 a.m. |
OK |
GNU C++17 |
TESTS |
34 |
31 |
0 |
|
|
249234922 |
Actium |
D1 |
March 2, 2024, 3:25 a.m. |
OK |
GNU C++17 |
TESTS |
34 |
31 |
0 |
|
|
249181482 |
ghc7hHx |
D1 |
March 1, 2024, 5:31 p.m. |
OK |
GNU C++17 (64) |
TESTS |
34 |
30 |
0 |
|
|
249170645 |
Belief_yfly |
D1 |
March 1, 2024, 4:32 p.m. |
OK |
GNU C++17 (64) |
TESTS |
34 |
30 |
0 |
|
|
249236712 |
MrPerson |
D1 |
March 2, 2024, 3:43 a.m. |
OK |
GNU C++17 (64) |
TESTS |
34 |
31 |
0 |
|
|
249233357 |
gsczl71 |
D1 |
March 2, 2024, 3:10 a.m. |
OK |
GNU C++17 (64) |
TESTS |
34 |
31 |
0 |
|
|
249232923 |
restar682 |
D1 |
March 2, 2024, 3:05 a.m. |
OK |
GNU C++17 (64) |
TESTS |
34 |
31 |
0 |
|
|
249252417 |
drizzle_codes |
D1 |
March 2, 2024, 5:58 a.m. |
OK |
GNU C++17 (64) |
TESTS |
34 |
31 |
0 |
|
|
249225767 |
Kevin_s1mple |
D1 |
March 2, 2024, 1:10 a.m. |
OK |
GNU C++17 (64) |
TESTS |
34 |
31 |
0 |
|
|
249224654 |
dannalc |
D1 |
March 2, 2024, 12:49 a.m. |
OK |
GNU C++17 (64) |
TESTS |
34 |
31 |
0 |
|
|
249230445 |
CodeChild |
D1 |
March 2, 2024, 2:33 a.m. |
OK |
GNU C++17 (64) |
TESTS |
34 |
31 |
0 |
|
|
249238563 |
DrZero0 |
D1 |
March 2, 2024, 4:02 a.m. |
OK |
GNU C++17 (64) |
TESTS |
34 |
31 |
0 |
|
|
249188930 |
MOHAMED--KHALED |
D1 |
March 1, 2024, 6:12 p.m. |
OK |
GNU C++20 (64) |
TESTS |
34 |
15 |
0 |
|
|
249231657 |
Kidding__Ma |
D1 |
March 2, 2024, 2:52 a.m. |
OK |
GNU C++20 (64) |
TESTS |
34 |
15 |
0 |
|
|
249229814 |
molongdadi |
D1 |
March 2, 2024, 2:23 a.m. |
OK |
GNU C++20 (64) |
TESTS |
34 |
15 |
0 |
|
|
249196219 |
r4m1m |
D1 |
March 1, 2024, 6:57 p.m. |
OK |
GNU C++20 (64) |
TESTS |
34 |
15 |
0 |
|
|
249195961 |
_r4m1m |
D1 |
March 1, 2024, 6:55 p.m. |
OK |
GNU C++20 (64) |
TESTS |
34 |
15 |
0 |
|
|
249186756 |
WillAppear |
D1 |
March 1, 2024, 6 p.m. |
OK |
GNU C++20 (64) |
TESTS |
34 |
15 |
0 |
|
|
249185961 |
Mher777 |
D1 |
March 1, 2024, 5:55 p.m. |
OK |
GNU C++20 (64) |
TESTS |
34 |
15 |
0 |
|
|
249183392 |
candy34 |
D1 |
March 1, 2024, 5:41 p.m. |
OK |
GNU C++20 (64) |
TESTS |
34 |
15 |
0 |
|
|
249178300 |
etherinmatic |
D1 |
March 1, 2024, 5:18 p.m. |
OK |
GNU C++20 (64) |
TESTS |
34 |
15 |
0 |
|
|
249177578 |
DGME |
D1 |
March 1, 2024, 5:15 p.m. |
OK |
GNU C++20 (64) |
TESTS |
34 |
15 |
0 |
|
|
249204418 |
FierteDeCeylan |
D1 |
March 1, 2024, 7:58 p.m. |
OK |
Java 21 |
TESTS |
34 |
311 |
512000 |
|
|
249176980 |
Eslam_Ahmed |
D1 |
March 1, 2024, 5:13 p.m. |
OK |
Java 21 |
TESTS |
34 |
327 |
409600 |
|
|
249223675 |
KYNick |
D1 |
March 2, 2024, 12:31 a.m. |
OK |
Java 21 |
TESTS |
34 |
327 |
614400 |
|
|
249224030 |
KYNick |
D1 |
March 2, 2024, 12:37 a.m. |
OK |
Java 21 |
TESTS |
34 |
342 |
409600 |
|
|
249170062 |
SamyajitDas |
D1 |
March 1, 2024, 4:32 p.m. |
OK |
Java 21 |
TESTS |
34 |
343 |
204800 |
|
|
249170647 |
Eslam_Ahmed |
D1 |
March 1, 2024, 4:32 p.m. |
OK |
Java 21 |
TESTS |
34 |
343 |
716800 |
|
|
249230838 |
faresbadr316 |
D1 |
March 2, 2024, 2:39 a.m. |
OK |
Java 21 |
TESTS |
34 |
358 |
102400 |
|
|
249223979 |
KYNick |
D1 |
March 2, 2024, 12:36 a.m. |
OK |
Java 21 |
TESTS |
34 |
358 |
512000 |
|
|
249179532 |
profchi |
D1 |
March 1, 2024, 5:22 p.m. |
OK |
Java 21 |
TESTS |
34 |
405 |
512000 |
|
|
249197962 |
daksh_02 |
D1 |
March 1, 2024, 7:09 p.m. |
OK |
Java 21 |
TESTS |
34 |
436 |
512000 |
|
|
249245750 |
MintCat |
D1 |
March 2, 2024, 5:08 a.m. |
OK |
Java 8 |
TESTS |
34 |
140 |
0 |
|
|
249236083 |
cc4414 |
D1 |
March 2, 2024, 3:36 a.m. |
OK |
Java 8 |
TESTS |
34 |
155 |
0 |
|
|
249230886 |
Yousef_Badr |
D1 |
March 2, 2024, 2:40 a.m. |
OK |
Java 8 |
TESTS |
34 |
186 |
0 |
|
|
249207062 |
Indrajit |
D1 |
March 1, 2024, 8:22 p.m. |
OK |
Java 8 |
TESTS |
34 |
186 |
7475200 |
|
|
249234172 |
optimus1369 |
D1 |
March 2, 2024, 3:18 a.m. |
OK |
Java 8 |
TESTS |
34 |
217 |
0 |
|
|
249234354 |
optimus1369 |
D1 |
March 2, 2024, 3:20 a.m. |
OK |
Java 8 |
TESTS |
34 |
233 |
0 |
|
|
249195632 |
Yousef_Badr |
D1 |
March 1, 2024, 6:53 p.m. |
OK |
Java 8 |
TESTS |
34 |
717 |
0 |
|
|
249190410 |
Noureldin |
D1 |
March 1, 2024, 6:21 p.m. |
OK |
PyPy 3 |
TESTS |
34 |
592 |
10342400 |
|
|
249197230 |
gardengnome |
D1 |
March 1, 2024, 7:04 p.m. |
OK |
PyPy 3-64 |
TESTS |
34 |
109 |
7680000 |
|
|
249229505 |
mikeac |
D1 |
March 2, 2024, 2:18 a.m. |
OK |
PyPy 3-64 |
TESTS |
34 |
170 |
10240000 |
|
|
249223547 |
RobinFromTheHood |
D1 |
March 2, 2024, 12:28 a.m. |
OK |
PyPy 3-64 |
TESTS |
34 |
187 |
10137600 |
|
|
249230533 |
sishenzhimu |
D1 |
March 2, 2024, 2:34 a.m. |
OK |
PyPy 3-64 |
TESTS |
34 |
187 |
10342400 |
|
|
249185176 |
el_tunel |
D1 |
March 1, 2024, 5:51 p.m. |
OK |
PyPy 3-64 |
TESTS |
34 |
202 |
10137600 |
|
|
249228919 |
mikeac |
D1 |
March 2, 2024, 2:08 a.m. |
OK |
PyPy 3-64 |
TESTS |
34 |
202 |
10342400 |
|
|
249183243 |
DeepJ |
D1 |
March 1, 2024, 5:40 p.m. |
OK |
PyPy 3-64 |
TESTS |
34 |
202 |
10547200 |
|
|
249186668 |
cybsbbb |
D1 |
March 1, 2024, 5:59 p.m. |
OK |
PyPy 3-64 |
TESTS |
34 |
217 |
10137600 |
|
|
249169820 |
Remineva |
D1 |
March 1, 2024, 4:31 p.m. |
OK |
PyPy 3-64 |
TESTS |
34 |
233 |
9932800 |
|
|
249193440 |
VeryLate |
D1 |
March 1, 2024, 6:39 p.m. |
OK |
PyPy 3-64 |
TESTS |
34 |
233 |
10137600 |
|
|
249177969 |
Abed_Alrhman_Alm7sere |
D1 |
March 1, 2024, 5:16 p.m. |
OK |
Python 3 |
TESTS |
34 |
108 |
1228800 |
|
|
249216837 |
FransValli |
D1 |
March 1, 2024, 10:08 p.m. |
OK |
Python 3 |
TESTS |
34 |
155 |
409600 |
|
|
remove filters
Back to search problems