답안 #1096793

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1096793 2024-10-05T06:54:45 Z KasymK Xoractive (IZhO19_xoractive) C++17
0 / 100
1 ms 344 KB
#include "bits/stdc++.h"
#include "interactive.h"
using namespace std;
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define ll long long
#define pb push_back
#define pii pair<int, int>
#define pli pair<ll, int>
#define pll pair<ll, ll>
#define tr(i, c) for(auto i = c.begin(); i != c.end(); ++i)
#define wr puts("----------------")
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}

vector<int> guess(int n){
    vector<int> answer;
    for(int ad = 1; ad <= n; ++ad){
        vector<int> A;
        int ad2;
        for(ad2 = ad; ad2 <= ad+4; ++ad2)
            A.pb(ad2);
        ad = ad2;
        A = get_pairwise_xor(A);
        assert((int)A.size() == 16);
        int a = ask(ad);
        vector<int> check, same;
        for(int mk = 0; mk < (1<<16); ++mk){
            int cnt = __builtin_popcount(mk);
            if(cnt != 4)
                continue;
            for(int i = 0; i < 16; ++i)
                if(mk>>i&1)
                    check.pb(A[i]);
            assert((int)check.size() == 4);
            for(int i = 0; i < 4; ++i){
                int x = a^check[i];
                check[i] = x;
            }
            for(int i = 0; i < 4; ++i)
                for(int j = 0; j < 4; ++j)
                    same.pb(check[i]^check[j]);
            assert((int)same.size() == 16);
            if(same == A){
                for(int i = 0; i < 4; ++i)
                    answer.pb(check[i]);
                break;
            }
            same.clear(), check.clear();
        }
    }
    return answer;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Not correct size
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -