Submission #1328285

#TimeUsernameProblemLanguageResultExecution timeMemory
1328285maomaoIsland Hopping (JOI24_island)C++20
Compilation error
0 ms0 KiB
#include "island.h"
#include <bits/stdc++.h>
using namespace std;
#define rep(i,s,n) for(int i=s;i<=n;i++)
#define vi vector<int>
#define pb push_back
#define pii pair<int,int>
#define eb emplace_back
#define fi first
#define se second
#define tup pair<int, pii>

void solve(int N, int L) {
  int i=1;
  vi vst(N+5, 0);
  while(i<N) {
	  if(answer_count==N-1) break;
	int j=vst[i]+1;
	while(j<=N) {
	  if(j>N-1 || answer_count==N-1) break;
	  int u=query(i,j);
	  if(vst[u]+1<=N-1 && query(u,vst[u]+1)==i) {
		  answer(u,i);vst[u]++;
	  } else break;
	  j++;
	}  
	i++;
  }
}

Compilation message (stderr)

island.cpp: In function 'void solve(int, int)':
island.cpp:17:14: error: 'answer_count' was not declared in this scope
   17 |           if(answer_count==N-1) break;
      |              ^~~~~~~~~~~~
island.cpp:20:23: error: 'answer_count' was not declared in this scope
   20 |           if(j>N-1 || answer_count==N-1) break;
      |                       ^~~~~~~~~~~~