76032024-01-10 01:05:18rennAutókódoláscpp17Wrong answer 0/503ms3860 KiB
#include <bits/stdc++.h>
#define ll long long
#define S 42

using namespace std;

ll N, kovval = 0, elozoval = 0, i;
bool elozo[S], kov[S], nincs_elozo;

int main() {

    cin >> N;
    N = 4294967296LL;

    for(ll i = 0; i < S; i++) {
        kov[S-1-i] = elozo[S-1-i] = N & (1LL << i);
    }
    
    nincs_elozo = prev_permutation(elozo, elozo + S);
    next_permutation(kov, kov + S);

    for(i = (S-1)*nincs_elozo; i >= 0; --i) {
        elozoval |= ((ll)elozo[i] << (S-1-i));
    }
    for(i = S-1; i >= 0; --i) {
        kovval |= ((ll)kov[i] << (S-1-i));
    }

    cout << (!nincs_elozo ? -1LL : elozoval) << "\n" << kovval << "\n";
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1876 KiB
2Accepted0/03ms2124 KiB
3Wrong answer0/23ms2328 KiB
4Wrong answer0/23ms2524 KiB
5Wrong answer0/23ms2740 KiB
6Wrong answer0/23ms2952 KiB
7Wrong answer0/23ms3124 KiB
8Wrong answer0/43ms3236 KiB
9Wrong answer0/43ms3440 KiB
10Wrong answer0/43ms3556 KiB
11Wrong answer0/42ms3556 KiB
12Wrong answer0/43ms3552 KiB
13Wrong answer0/43ms3676 KiB
14Wrong answer0/42ms3788 KiB
15Wrong answer0/42ms3676 KiB
16Wrong answer0/43ms3772 KiB
17Wrong answer0/42ms3860 KiB