# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
751846 | ndh990 | Job Scheduling (CEOI12_jobs) | C++11 | 422 ms | 26436 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 int ll;
typedef pair<int, int> pairs;
using vi = vector<ll>;
#define mp make_pair
ll n,d,m;
pair<bool, vector<vi>> isFeasible(const vector<pairs> &jobs, int machineCount) {
vector<vi> schedule(n);
ll reqNum = 0;
for (ll day = 1; day <= n; day++) {
for (ll j = 0; j < machineCount; j++) {
if(jobs[reqNum].first>day)
{
break;
}
if(jobs[reqNum].first+d>=day)
{
schedule[day-1].push_back(jobs[reqNum++].second);
}
else return mp(false, schedule);
if (reqNum == m) return mp(true, schedule);
}
}
return mp(false, schedule);
}
int main()
{
cin.tie(0)->sync_with_stdio(false);
cin >> n >> d >> m;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |