QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#410684#6663. 회의실 2socpite2Compile Error//C++231.1kb2024-05-14 11:21:352024-05-14 11:21:35

Judging History

你现在查看的是最新测评结果

  • [2024-05-14 11:21:35]
  • 评测
  • [2024-05-14 11:21:35]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

const int mod = 1e9+7;
const int maxn = 3e5+5;

bool cmp(pair<int, int> a, pair<int, int> b){
	return a.first != b.first ? a < b : a.second > b.second;
}

pair<int, vector<int> > complaint(int N, vector<int> L, vector<int> R){
	vector<pair<int, int>> vec;
	for(int i = 0; i < L.size(); i++){
		vec.push_back({R[i], L[i]});
	}
	sort(vec.begin(), vec.end());
	int crr = -1, l = 0, last = -1;
	int ans = 0;
	vector<int> re;
	for(auto v: vec){
		if(v.second > crr){
			for(int j = l; j <= crr; j++)re.push_back(j);
			ans++;
			last = crr;
			crr = v.first;
			l = v.second;
		}
		else {
			if(v.second <= last)continue;
			l = max(l, v.second);
		}
	}
	for(int j = l; j <= crr; j++)re.push_back(j);
	return make_pair(ans, re);
}

// int main() {
// 	auto ans = complaint(10, {1, 4, 8, 2}, {4, 7, 9, 6});
// 	cout << ans.first << endl;
// 	for(auto v: ans.second)cout << v << " ";
// }
// int main(){
// 	cout << maintenance_costs_sum({0, 2, 2, 0}, {2, 1, 4, 3}, {2, 3, 6, 5}) << endl;;
// }

详细

/usr/bin/ld: /tmp/ccg2xZ3f.o: in function `main':
implementer.cpp:(.text.startup+0x107): undefined reference to `count_removals(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status