Submission #151284

# Submission time Handle Problem Language Result Execution time Memory
151284 2019-09-02T11:50:48 Z theboatman Xoractive (IZhO19_xoractive) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "interactive.h"

#define y1 theboatman
#define make_struct(args...) {args}

using namespace std;

typedef long long ll;

const long long INF = 1e18 + 10;
const int inf = 1e9 + 10;
const int N = 1e6 + 10;

//vector <int> get_pairwise_xor(vector <int> a) {
//    return vector <int> (3);
//}
//
//int ask(int pos) {
//    return pos;
//}

vector <int> guess(int n) {
    vector <int> ans(n);

    ans[0] = ask(1);

    vector <int> b, b1;
    for(int i = 1; i <= n; i++) {
        b.push_back(i);

        if (i != 1) {
            b1.push_back(i);
        }
    }

    map <int, int> cnt;
    for(auto i : get_pairwise_xor(b)) {
        cnt[i]++;
    }

    for(auto i : get_pairwise_xor(b1)) {
        cnt[i]--;
    }

    vector <int> vals;
    for(auto i : cnt) {
        if (i.second) {
            vals.push_back(i.first);
        }
    }

    int now = 1;
    while(now + 3 < n) {
        vector <int> c, c1;
        c.push_back(now);
        c.push_back(now + 1);

        c1.push_back(now + 1);
        c1.push_back(now + 2);

        vector <int> kek = get_pairwise_xor(c);
        vector <int> kek1 = get_pairwise_xor(c);

        int flag = 0;
        for(auto x : vals) {
            if (flag) {
                break;
            }
            for(auto y : vals) {
                if (flag) {
                    break;
                }
                for(auto z : vals) {
                    vector <int> first;
                    first.push_back(x ^ x);
                    first.push_back(x ^ y);
                    first.push_back(x ^ y);
                    first.push_back(y ^ y);

                    vector <int> second;
                    second.push_back(y ^ y);
                    second.push_back(y ^ z);
                    second.push_back(y ^ z);
                    second.push_back(z ^ z);

                    sort(first.begin(), first.end());
                    sort(second.begin(), second.end());

                    if (first == kek && second == kek1) {
                        ans[now++] = x;
                        ans[now++] = y;
                        ans[now++] = z;

                        flag = 1;
                        break;
                    }
                }
            }
        }
    }

    while(now < n) {
        ans[now] = ask(now + 1);
        now++;
    }

    return ans;
}

int main() {
    return 0;
}

/*
*/

Compilation message

/tmp/ccwIYMN7.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccwYp3a1.o:Xoractive.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status