# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
419361 | freshmintt | Job Scheduling (CEOI12_jobs) | C++14 | 559 ms | 24020 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 MAXN 1000000 //change. SET A SPACIOUS MAXN WHEN TESTING SO YOU DONT MESS UP WITH GARBAGE VALS OR SHIT
using namespace std;
typedef pair<int, int> pi;
typedef int ll;
ll N, D, M;
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// vector<ll> jobs;
vector<pi> jobs_save;
ll days[MAXN];
vector<ll> plan[100005];
bool make_plan(ll machs) {
fill(days, days+MAXN, 0);
for (int i=0; i < M; i++) {
ll machID = i % machs;
days[machID] = max(days[machID]+1, jobs_save[i].first); // ++ vs +1, obstructs with comparison.
plan[days[machID]-1].push_back(jobs_save[i].second+1);
}
return true;
}
bool works(ll machs) {
fill(days, days+MAXN, 0);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |