# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
597186 |
2022-07-15T16:56:57 Z |
Trisanu_Das |
Hotel (CEOI11_hot) |
C++17 |
|
1209 ms |
56244 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long int
signed main(){
int n, m, o; cin >> n >> m >> o;
multiset<pair<int, int> > rooms;
for(int i = 0; i < n; i++){
int c, p; cin >> c >> p; rooms.insert({c, p});
}
pair<int, int> requests[m];
for(int i = 0; i < m; i++) cin >> requests[i].first >> requests[i].second;
sort(requests, requests + m, [] (pair<int, int> i, pair<int, int> j)
{
return i.second > j.second;
});
int ans = 0;
vector<int> choosed;
for(pair<int, int> p : requests){
int req = p.first, price = p.second;
auto choice = rooms.lower_bound({req, -1});
if(choice == rooms.end()) continue;
if(price > choice->second) choosed.push_back(price - choice->second);
}
sort(choosed.begin(), choosed.end(), greater<int>());
for(int i = 0; i < o; i++) ans += choosed[i];
cout << ans << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
15 ms |
1364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
86 ms |
5160 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
179 ms |
14768 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
502 ms |
41036 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1063 ms |
48116 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1209 ms |
56244 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |