답안 #590600

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
590600 2022-07-06T07:20:50 Z UncoolAnon Bubble Sort 2 (JOI18_bubblesort2) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h> 
#define int long long 
#define pii pair<int,int> 
#define F first 
#define S second 
#define mp make_pair 
#define endl '\n'
using namespace std; 
const int inf=1e9,N=2e5+5,md=1e9+7; 
vector<int> countScans(vector<int> a ,vector<int> x , vector<int> v){
	vector<int> answer(x.size());
	for(int i=0;i<x.size();i++){
		a[x[i]]=v[i]; 
		vector<int> q; 
		for(int&x:a){
			while(q.size()&&q.back()>x){q.pop_back();++answer[i];}
			q.push_back(x); 
		}
	}
	return answer; 
}

Compilation message

bubblesort2.cpp: In function 'std::vector<long long int> countScans(std::vector<long long int>, std::vector<long long int>, std::vector<long long int>)':
bubblesort2.cpp:12:15: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |  for(int i=0;i<x.size();i++){
      |              ~^~~~~~~~~
/usr/bin/ld: /tmp/ccXBYdpE.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