CF1688A.Cirno's Perfect Bitmasks Classroom
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Even if it's a really easy question, she won't be able to answer it
— Perfect Memento in Strict Sense
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 \\gt 0$$ $$x\\ \\texttt{xor}\\ y \\gt 0Where and is the bitwise AND operation, and xor is the bitwise XOR operation.
Among the students was Mystia, who was truly baffled by all these new operators. Please help her!
即使这是一道非常简单的题目,她也无法回答。
——《严格意义下的完美记忆》
琪露诺的完美位运算课堂刚刚开始!
琪露诺给了她的学生们一个正整数 x。作为课后作业,学生们需要找出满足以下两个条件的最小正整数 y:
x\ \texttt{and}\ y > 0$$ $$x\ \texttt{xor}\ y > 0学生中有一位名叫 Mystia 的同学,面对这些全新的运算符完全不知所措。请帮帮她!
输入格式
The first line of input contains a single integer t (1≤t≤103) — the number of input test cases.
For each test case, the only line of input contains one integer x (1≤x≤230).
输入的第一行包含一个整数 t(1≤t≤103)—— 表示输入测试用例的数量。
对于每个测试用例,输入的唯一一行包含一个整数 x(1≤x≤230)。
输出格式
For each test case, print a single integer — the minimum number of y.
对于每个测试用例,输出一个整数——即 y 的最小值。
输入输出样例
输入#1
7 1 2 5 9 16 114514 1000000
输出#1
3 3 1 1 17 2 64
说明/提示
Test case 1:
1and3=1>0, 1xor3=2>0.
Test case 2:
2and3=2>0, 2xor3=1>0.
测试用例 1:
1and3=1>0, 1xor3=2>0。
测试用例 2:
2and3=2>0, 2xor3=1>0。
输入解题思路,AI测评打分。不知道怎么写?