QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#357677 | #8132. Freshman's Dream | moeezm# | WA | 0ms | 3556kb | C++14 | 523b | 2024-03-19 08:00:34 | 2024-03-19 08:00:34 |
Judging History
answer
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
using ll = long long;
void solve() {
ll n; cin >> n;
ll firstrun = 0;
ll b = 0;
for (int i = 0; i < 60; i++) {
if ((1LL<<i) & n) {
b = (1LL << i);
}
}
ll a = n ^ b;
if (a > 0) {
assert((a+b)^n == (a^(n+b)^n));
cout << a << ' ' << endl;
}
else {
cout << -1 << endl;
}
}
int main() {
int t; cin >> t; while(t--) solve();
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3556kb
input:
5 2 3 6 10 18
output:
-1 1 2 2 2
result:
wrong answer jury has answer but participant doesn't