QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#357677#8132. Freshman's Dreammoeezm#WA 0ms3556kbC++14523b2024-03-19 08:00:342024-03-19 08:00:34

Judging History

你现在查看的是最新测评结果

  • [2024-03-19 08:00:34]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3556kb
  • [2024-03-19 08:00:34]
  • 提交

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();
}

Details

Tip: Click on the bar to expand more detailed information

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