# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
204528 |
2020-02-26T08:42:51 Z |
Saboon |
Hotel (CEOI11_hot) |
C++14 |
|
1137 ms |
49252 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 10;
pair<int,int> offer[maxn];
int main(){
ios_base::sync_with_stdio(false);
int n, m, o;
cin >> n >> m >> o;
multiset<pair<int,int> > room;
for (int i = 0; i < n; i++){
int p, c;
cin >> p >> c;
room.insert({c, p});
}
for (int i = 0; i < m; i++){
int v, d;
cin >> v >> d;
offer[i] = {v, d};
}
sort(offer, offer + m);
reverse(offer, offer + m);
vector<int> vals;
for (int i = 0; i < m; i++){
auto it = room.lower_bound({offer[i].second, 0});
if (it == room.end())
continue;
vals.push_back(offer[i].first - it->second);
room.erase(it);
}
sort(vals.rbegin(), vals.rend());
ll sum = 0;
for (int i = 0; i < min((int)vals.size(), o); i++)
sum += vals[i];
cout << sum << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
376 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
1272 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
69 ms |
4472 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
104 ms |
7544 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
360 ms |
20180 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
906 ms |
39968 KB |
Output is correct |
2 |
Incorrect |
1110 ms |
39892 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
990 ms |
46188 KB |
Output is correct |
2 |
Incorrect |
1137 ms |
49252 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |