# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
302354 | ElyesChaabouni | Hiring (IOI09_hiring) | C++14 | 789 ms | 18616 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 MOD 998244353
using namespace std;
bool compare(pair<int, int>a, pair<int, int>b)
{
return a.first*b.second < a.second*b.first;
}
int main()
{
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
long long n, w;
cin >> n >> w;
vector<pair<long long, long long> >v;
for(int i = 0; i < n; i++)
{
int x, y;
cin >> x >> y;
v.push_back(make_pair(x, y));
}
sort(v.begin(), v.end(), compare);
priority_queue<pair<int, int> >pq;
long long sum=0;
long long ma=0, idx=0, ma_v_s, ma_v_q;
for(int i = 0; i < n; i++)
{
sum+=v[i].second;
pq.push(make_pair(v[i].second, i));
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |