Submission #984469

# Submission time Handle Problem Language Result Execution time Memory
984469 2024-05-16T17:17:43 Z 3mara Swapping Cities (APIO20_swap) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

const int N=505;

int dp[N]; 

int minimumInstructions(int n, int m, int K, vector<int> v, vector<int> A, vector<vector<int>> a) {
  	for(int i=0;i<n;i++) dp[i]=1e9;
  	dp[0]=0;
  	for(int i=0;i<=n-m;i++){
  		bool flag=0;
  		for(int ii=0;ii<m;ii++){
  			flag=0; int j=ii;
  			for(int cnt=0;cnt<m;cnt++){
	  			if(!binary_search(a[j].begin(),a[j].end(),v[i+cnt])) flag=1;
	  			if(flag) break;
	  			j++; j%=m;
	  		}
	  		if(!flag) break;
  		}
  		if(!flag){
  			for(int j=1;j<min(n,m+1);j++) dp[i+j]=min(dp[i]+1,dp[i+j]);
  		}
  	}
  	if(dp[n-1]>=1e9) return -1;
  	return dp[n-1];
}

Compilation message

/usr/bin/ld: /tmp/cchVkMxq.o: in function `main':
grader.cpp:(.text.startup+0x1c3): undefined reference to `init(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
/usr/bin/ld: grader.cpp:(.text.startup+0x217): undefined reference to `getMinimumFuelCapacity(int, int)'
collect2: error: ld returned 1 exit status