제출 #387208

#제출 시각아이디문제언어결과실행 시간메모리
387208KalashnikovXoractive (IZhO19_xoractive)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout) #define all(a) a.begin() , a.end() #define F first #define S second using namespace std; using ll = long long; const int N = 2e5+5 , inf = 2e9 + 7; const ll INF = 1e18 , mod = 1e9+7 , P = 6547; vector<int> guess(int n) { vector<int> a(n); a[0] = ask(1); map<int,int> ans; for(int i = 0; (1 << i) <= n; i ++) { vector<int> p; for(int j = 2; j <= n; j ++) { if(j & (1 << i)) { p.push_back(j); } } auto g1 = get_pairwise_xor(p); p.push_back(1); auto g2 = get_pairwise_xor(p); map<int,int> mp; for(auto to: g2) mp[to] ++; for(auto to: g1) mp[to] --; for(auto to: mp) { if(to.S) { ans[to.F^a[0]] |= (1 << i); } } } for(auto to: ans) { a[to.S-1] = to.F; } return a; }

컴파일 시 표준 에러 (stderr) 메시지

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:17:9: error: 'ask' was not declared in this scope
   17 |  a[0] = ask(1);
      |         ^~~
Xoractive.cpp:26:13: error: 'get_pairwise_xor' was not declared in this scope
   26 |   auto g1 = get_pairwise_xor(p);
      |             ^~~~~~~~~~~~~~~~