#include "speedrun.h"
#include <iostream>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iterator>
#include <limits>
#include <list>
#include <cstring>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <unordered_map>
using namespace std;
typedef int ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;
#ifdef px
#define p(x) cerr<<#x<<' '<<x<<endl;
#else
#define p(x) {}
#endif
#define F first
#define S second
#define sz size
#define ls s,m,idx<<1
#define rs m+1,e,idx<<1|1
const ll MOD=ll(1e9)+7;
const ll MAXN=2*ll(1e6);
ll posa[2001]={};
ll arxi=1;
void assignHints(int subtask, int N, int A[], int B[]) { /* your solution here */
setHintLen(20);
int pai = 0;
for(int i = 1; i < N; i++){
freq[A[i]]++;
freq[B[i]]++;
if(A[i] > 1){
pai = A[i];
break;
}
if(B[i] > 1){
pai = B[i];
break;
}
}
for(int i = 1; i <= N; i++){
if(i == pai) continue;
for(int j = 0; j < 10; j++){
if((1<<j) & pai) setHint(i, j+1, 1);
}
}
}
int l;
void speedrun(int subtask, int N, int start) { /* your solution here */
l = getLength();
int pai = 0;
for(int i = 1; i <= 10; i++){
if(getHint(i)){
pai |= (1<<(i-1));
}
}
if(pai == 0){
for(int i = 1; i <= N; i++){
if(i == start) continue;
goTo(i);
goTo(start);
}
}else{
goTo(pai);
for(int i = 1; i <= N; i++){
if(i == pai) continue;
goTo(i);
goTo(pai);
}
}
}
Compilation message
speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:45:3: error: 'freq' was not declared in this scope; did you mean 'free'?
45 | freq[A[i]]++;
| ^~~~
| free