Submission #385244

# Submission time Handle Problem Language Result Execution time Memory
385244 2021-04-03T19:30:57 Z ritul_kr_singh Hotel (CEOI11_hot) C++17
20 / 100
1081 ms 43736 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define sp << ' ' <<
#define nl << '\n'
 
signed main(){
	cin.tie(0)->sync_with_stdio(0);
	int n, m, o; cin >> n >> m >> o;
	array<int, 2> offers[m], room;
	multiset<array<int, 2>> rooms;
	for(int i=0; i<n; ++i){
		cin >> room[1] >> room[0];
		rooms.insert(room);
	}
	for(auto &i : offers) cin >> i[0] >> i[1], i[1] = -i[1];
	sort(offers, offers+m, greater<>());
	vector<int> pos;
 
	for(auto &i : offers){
		auto f = rooms.lower_bound({-i[1], 0});
		if(f != rooms.end()){
			pos.push_back(i[0] - (*f)[1]);
			rooms.erase(f);
		}
	}
 
	sort(pos.begin(), pos.end(), greater<>());
	cout << accumulate(pos.begin(), pos.begin()+o, 0LL);
 
 
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 1132 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 50 ms 4080 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 101 ms 7020 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 361 ms 18132 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 819 ms 35932 KB Output is correct
2 Incorrect 1006 ms 35932 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 998 ms 43736 KB Output is correct
2 Incorrect 1081 ms 43712 KB Output isn't correct
3 Halted 0 ms 0 KB -