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"Cirno's perfect bitmasks classroom has just started! Cirno gave her students a positive integer x . As an assignment, her students need to find the minimum positive integer y , which satisfies the following two conditions: x texttt{and} y > 0 x texttt{xor} y > 0 Where texttt{and} is the bitwise AND operation, and texttt{xor} is the bitwise XOR operation. Among the students was Mystia, who was truly baffled by all these new operators. Please help her! The first line of input contains a single integer t ( 1 <= q t <= q 10^3 ) -- the number of input test cases. For each test case, the only line of input contains one integer x ( 1 <= q x <= q 2^{30} ). For each test case, print a single integer -- the minimum number of y . Test case 1: 1 ; texttt{and} ; 3=1>0 , 1 ; texttt{xor} ; 3=2>0 . Test case 2: 2 ; texttt{and} ; 3=2>0 , 2 ; texttt{xor} ; 3=1>0 . "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
159429056 |
RieBi |
A |
June 3, 2022, 7:40 p.m. |
OK |
C# 10 |
TESTS |
6 |
46 |
0 |
|
|
159428918 |
RieBi |
A |
June 3, 2022, 7:38 p.m. |
OK |
C# 10 |
TESTS |
6 |
46 |
0 |
|
|
remove filters
Back to search problems