Submission #199366

# Submission time Handle Problem Language Result Execution time Memory
199366 2020-01-31T17:28:31 Z mahmoudbadawy Bubble Sort 2 (JOI18_bubblesort2) C++17
Compilation error
0 ms 0 KB
#include "bubblesort2.h"
#include <bits/stdc++.h>
#define F first
#define S second

using namespace std;

const int N=500005;
pair<int,int> arr[N];

vector<int> count_scans(vector<int> A,vector<int> X,vector<int> V)
{
	int n=A.size();
	vector<int> v;
	for(int i=0;i<X.size();i++)
	{
		A[X[i]]=V[i];
		for(int i=0;i<n;i++)
		{
			arr[i].F=A[i]; arr[i].S=i;
		}
		sort(arr,arr+n);
		int ans=0;
		for(int i=0;i<n;i++) ans=max(ans,max(arr[i].S-i,0));
		v.push_back(ans);
	}
	return v;
}

Compilation message

bubblesort2.cpp: In function 'std::vector<int> count_scans(std::vector<int>, std::vector<int>, std::vector<int>)':
bubblesort2.cpp:15:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<X.size();i++)
              ~^~~~~~~~~
/tmp/ccBssk1T.o: In function `main':
grader.cpp:(.text.startup+0x125): undefined reference to `countScans(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status