# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
89095 | Lkvatashidze | Schools (IZhO13_school) | C++17 | 246 ms | 18060 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define ll long long
using namespace std;
multiset < pair < ll, ll > > x;
vector < pair < ll, ll > > v;
multiset < pair < ll, ll > > st;
ll n, m, s, ans;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll n, m, s;
cin >> n >> m >> s;
for (ll k=1; k<=n; k++) {
ll z, y;
cin >> z >> y;
v.push_back({z,y});
}
sort(v.begin(),v.end());
reverse(v.begin(),v.end());
for (ll k=0; k<m; k++)
ans+=v[k].first;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |