Submission #475768

# Submission time Handle Problem Language Result Execution time Memory
475768 2021-09-24T03:44:37 Z abc864197532 Xoractive (IZhO19_xoractive) C++17
100 / 100
5 ms 456 KB
/*
 *   ##   #####   ####      ####  #    #  ####
 *  #  #  #    # #    #    #    # #    # #    #
 * #    # #####  #         #    # #    # #    #
 * ###### #    # #         #    # # ## # #    #
 * #    # #    # #    #    #    # ##  ## #    #
 * #    # #####   ####      ####  #    #  ####
 */
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair <int, int>
#define X first
#define Y second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define info() cout << __PRETTY_FUNCTION__ << ": " << __LINE__ << endl
void abc() {cout << endl;}
template <typename T, typename ...U> void abc(T a, U ...b) {
    cout << a << ' ', abc(b...);
}
template <typename T> void printv(T l, T r) {
    for (; l != r; ++l) cout << *l << " \n"[l + 1 == r];
}
template <typename A, typename B> istream& operator >> (istream& o, pair<A, B> &a) {
    return o >> a.X >> a.Y;
}
template <typename A, typename B> ostream& operator << (ostream& o, pair<A, B> a) {
    return o << '(' << a.X << ", " << a.Y << ')';
}
template <typename T> ostream& operator << (ostream& o, vector<T> a) {
    bool is = false;
    if (a.empty()) return o << "{}";
    for (T i : a) {o << (is ? ' ' : '{'), is = true, o << i;}
    return o << '}';
}
template <typename T> struct vv : vector <vector <T>> {
    vv(int n, int m, T v) : vector <vector <T>> (n, vector <T>(m, v)) {}
    vv() {}
};
template <typename T> struct vvv : vector <vv <T>> {
    vvv(int n, int m, int k, T v) : vector <vv <T>> (n, vv <T>(m, k, v)) {}
    vvv() {}
};
#ifdef Doludu
#define test(args...) info(), abc("[" + string(#args) + "]", args)
#define owo freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout); 
#else
#define test(args...) void(0)
#define owo ios::sync_with_stdio(false); cin.tie(0)
#endif
const int mod = 998244353, N = 300001, logN = 20, K = 111;

int ask(int i);

vector <int> get_pairwise_xor(vector <int> pos);


vector <int> guess (int n) {
    int a0 = ask(1);
    map <int, int> res;
    for (int k = 0; k < 7; ++k) {
        vector <int> v;
        for (int i = 1; i < n; ++i) if (i >> k & 1) {
            v.pb(i + 1);
        }
        if (v.empty())
            continue;
        vector <int> tmp = get_pairwise_xor(v);
        v.pb(1);
        vector <int> tmp2 = get_pairwise_xor(v);
        map <int, int> m1;
        for (int i : tmp)
            m1[i]--;
        for (int i : tmp2)
            m1[i]++;
        for (pii i : m1) if (i.Y > 0 && i.X > 0)
            res[i.X] |= 1 << k;
    }
    vector <int> ans(n);
    ans[0] = a0;
    for (pii i : res)
        ans[i.Y] = i.X ^ ans[0];
    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB Output is correct
2 Correct 0 ms 200 KB Output is correct
3 Correct 0 ms 200 KB Output is correct
4 Correct 0 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 328 KB Output is correct
2 Correct 4 ms 328 KB Output is correct
3 Correct 2 ms 328 KB Output is correct
4 Correct 4 ms 328 KB Output is correct
5 Correct 4 ms 328 KB Output is correct
6 Correct 4 ms 328 KB Output is correct
7 Correct 2 ms 328 KB Output is correct
8 Correct 3 ms 328 KB Output is correct
9 Correct 4 ms 328 KB Output is correct
10 Correct 4 ms 380 KB Output is correct
11 Correct 2 ms 328 KB Output is correct
12 Correct 4 ms 328 KB Output is correct
13 Correct 3 ms 328 KB Output is correct
14 Correct 4 ms 456 KB Output is correct
15 Correct 2 ms 328 KB Output is correct
16 Correct 5 ms 328 KB Output is correct
17 Correct 4 ms 328 KB Output is correct
18 Correct 4 ms 328 KB Output is correct
19 Correct 2 ms 328 KB Output is correct
20 Correct 4 ms 380 KB Output is correct
21 Correct 4 ms 328 KB Output is correct
22 Correct 4 ms 328 KB Output is correct
23 Correct 2 ms 328 KB Output is correct
24 Correct 5 ms 384 KB Output is correct
25 Correct 4 ms 328 KB Output is correct
26 Correct 4 ms 328 KB Output is correct
27 Correct 3 ms 328 KB Output is correct
28 Correct 4 ms 328 KB Output is correct
29 Correct 4 ms 380 KB Output is correct
30 Correct 4 ms 328 KB Output is correct
31 Correct 2 ms 328 KB Output is correct
32 Correct 4 ms 328 KB Output is correct
33 Correct 4 ms 328 KB Output is correct
34 Correct 4 ms 328 KB Output is correct
35 Correct 3 ms 328 KB Output is correct
36 Correct 4 ms 328 KB Output is correct
37 Correct 4 ms 328 KB Output is correct
38 Correct 3 ms 328 KB Output is correct
39 Correct 2 ms 328 KB Output is correct
40 Correct 4 ms 380 KB Output is correct
41 Correct 4 ms 328 KB Output is correct
42 Correct 4 ms 328 KB Output is correct
43 Correct 2 ms 328 KB Output is correct
44 Correct 4 ms 328 KB Output is correct
45 Correct 4 ms 328 KB Output is correct
46 Correct 4 ms 328 KB Output is correct
47 Correct 2 ms 328 KB Output is correct
48 Correct 4 ms 328 KB Output is correct
49 Correct 4 ms 328 KB Output is correct
50 Correct 4 ms 328 KB Output is correct
51 Correct 2 ms 328 KB Output is correct
52 Correct 4 ms 328 KB Output is correct
53 Correct 4 ms 328 KB Output is correct
54 Correct 4 ms 328 KB Output is correct
55 Correct 2 ms 328 KB Output is correct
56 Correct 4 ms 328 KB Output is correct
57 Correct 4 ms 328 KB Output is correct
58 Correct 3 ms 328 KB Output is correct
59 Correct 2 ms 328 KB Output is correct
60 Correct 5 ms 328 KB Output is correct
61 Correct 4 ms 328 KB Output is correct
62 Correct 4 ms 328 KB Output is correct
63 Correct 2 ms 328 KB Output is correct
64 Correct 4 ms 328 KB Output is correct
65 Correct 4 ms 328 KB Output is correct
66 Correct 3 ms 328 KB Output is correct
67 Correct 2 ms 328 KB Output is correct
68 Correct 3 ms 328 KB Output is correct
69 Correct 4 ms 380 KB Output is correct
70 Correct 4 ms 328 KB Output is correct
71 Correct 2 ms 328 KB Output is correct
72 Correct 4 ms 328 KB Output is correct
73 Correct 4 ms 328 KB Output is correct
74 Correct 3 ms 456 KB Output is correct
75 Correct 2 ms 332 KB Output is correct
76 Correct 4 ms 328 KB Output is correct
77 Correct 3 ms 328 KB Output is correct
78 Correct 4 ms 328 KB Output is correct
79 Correct 2 ms 328 KB Output is correct
80 Correct 4 ms 328 KB Output is correct
81 Correct 4 ms 328 KB Output is correct
82 Correct 4 ms 332 KB Output is correct
83 Correct 2 ms 328 KB Output is correct
84 Correct 4 ms 328 KB Output is correct
85 Correct 4 ms 332 KB Output is correct
86 Correct 4 ms 332 KB Output is correct
87 Correct 3 ms 328 KB Output is correct
88 Correct 5 ms 332 KB Output is correct
89 Correct 4 ms 332 KB Output is correct
90 Correct 4 ms 328 KB Output is correct
91 Correct 3 ms 332 KB Output is correct
92 Correct 4 ms 332 KB Output is correct
93 Correct 4 ms 328 KB Output is correct
94 Correct 4 ms 456 KB Output is correct
95 Correct 2 ms 328 KB Output is correct
96 Correct 4 ms 328 KB Output is correct
97 Correct 3 ms 332 KB Output is correct
98 Correct 3 ms 328 KB Output is correct
99 Correct 3 ms 328 KB Output is correct
100 Correct 4 ms 328 KB Output is correct