# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
661473 | yashsingh | Job Scheduling (CEOI12_jobs) | C++17 | 637 ms | 65536 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>
using namespace std;
typedef long long ll;
ll n, d, m;
bool sort2(pair<ll,ll>a,pair<ll,ll>b) {
return a.second < b.second;
}
bool val(ll machines, pair<ll,ll> a[]) {
map<ll,ll> ma;
ma.insert({0, machines});
pair<ll,ll> val;
for (ll i{0}; i < m; ++i) {
auto search = ma.upper_bound(a[i].first+d);
val = *prev(search);
if (search == ma.begin()) {
return 0;
} else {
prev(search)->second = val.second - 1;
if (val.second == 1) {
ma.erase(prev(search));
}
++ma[max(val.first, a[i].first)+1];
if (max(val.first, a[i].first) > n) {
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |