Submission #408798

# Submission time Handle Problem Language Result Execution time Memory
408798 2021-05-19T16:22:43 Z gg123_pe Bubble Sort 2 (JOI18_bubblesort2) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "bubblesort2.h"
using namespace std; 
typedef vector<long long> vl; 

typedef long long ll; 
#define f(i,a,b) for(ll i=a ; i<b ; i++)

vl countScans(vl A, vl X, vl V){
	int q = X.size(), n = A.size(); 
    vl ans, v; 
    f(i,0,q){
        v.clear(); 
        ll mini = 1e9+5, aux = 0;  
        f(i,0,n)
            mini = min(mini,A[i]);
        f(i,0,n){
            if(A[i] == mini)
            v.push_back(i); 
        }
        ll l = v.size();
        f(i,0,l)
            aux = max(aux,abs(v[i]-i));
        ans.push_back(aux);    
    }
    return ans; 

}
int main(){
	ll N, Q, a1, x1, v1; 
    vl A, X, V;
    cin >> N >> Q;
    f(i,0,N) {
		cin >> a1; 
		A.push_back(a1);
	}  
    f(i,0,Q){
		cin >> x1 >> v1; 
		X.push_back(x1); V.push_back(v1); 
    }
    countScans(A, X, V); 
    return 0; 
}

Compilation message

/usr/bin/ld: /tmp/ccy3Q5gE.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccwVvuaE.o:bubblesort2.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccy3Q5gE.o: in function `main':
grader.cpp:(.text.startup+0x19f): 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