답안 #475766

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
475766 2021-09-24T03:37:49 Z abc864197532 Xoractive (IZhO19_xoractive) C++17
컴파일 오류
0 ms 0 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);
        }
        vector <int> tmp = ask(v);
        v.pb(1);
        vector <int> tmp2 = ask(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)
            res[i.X] |= 1 << k;
    }
    vector <int> ans(n);
    ans[0] = a0;
    for (pii i : res)
        ans[i.Y] = i.X;
    return ans;
}

Compilation message

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:70:32: error: cannot convert 'std::vector<int>' to 'int'
   70 |         vector <int> tmp = ask(v);
      |                                ^
      |                                |
      |                                std::vector<int>
Xoractive.cpp:57:13: note:   initializing argument 1 of 'int ask(int)'
   57 | int ask(int i);
      |         ~~~~^
Xoractive.cpp:72:33: error: cannot convert 'std::vector<int>' to 'int'
   72 |         vector <int> tmp2 = ask(v);
      |                                 ^
      |                                 |
      |                                 std::vector<int>
Xoractive.cpp:57:13: note:   initializing argument 1 of 'int ask(int)'
   57 | int ask(int i);
      |         ~~~~^