답안 #550499

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
550499 2022-04-18T09:55:26 Z Killer2501 Xoractive (IZhO19_xoractive) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define ull unsigned long long
#define pb push_back
#define pll pair<int, pii>
#define pii pair<int, int>
#define fi first
#define se second
#include "interactive.h"
using namespace std;
const int N = 2e5+5;
const int M = 350;
const int mod = 1e9+7;
const ll base = 75;
const ll inf = 1e12;
int n, t, tong;
int k, m, a[N], b[N];
ll ans, dp[N], d[N];
vector<int> adj[N], gr[N];
vector<pii> g[N];
vector<int> guess(int n)
{
    vector<int> res;
    map<int, int> mp;
    res.resize(n);
    res[n-1] = ask(n);
    for(int j = 0; j < 8; j ++)
    {
        vector<int> l, r, vi;
        for(int i = 1; i < n; i ++)
            if(i >> j & 1)vi.pb(i);
        l = get_pairwise_xor(vi);
        vi.pb(n);
        r = get_pairwise_xor(vi);
        for(int il =(int) l.size()-1, ir = (int) r.size()-1; il >= 0;)
        {
            if(l[il] == r[ir])
            {
                l.pop_back();
                swap(r[ri], r.back());
                r.pop_back();
                --il;
                --ir;
            }
            else --ir;
        }
        for(int x: l)mp[x^res[n-1]] |= (1<<j);
    }
    for(pii x: mp)res[x.se-1] = x.fi;
    return res;
}

Compilation message

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:41:24: error: 'ri' was not declared in this scope; did you mean 'ir'?
   41 |                 swap(r[ri], r.back());
      |                        ^~
      |                        ir