제출 #674280

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6742802022-12-23 16:24:08thienbao1602Job Scheduling (CEOI12_jobs)C++17
35 / 100
398 ms63592 KiB
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define vi vector<ll>
using namespace std;
const int N = 1e5 + 55;
int days, delay, number_jobs;
vector<pair<ll, ll>> jobs;
vector<vi> ans;
pair<bool, vector<vi>> check(const vector<pair<ll, ll>> jobs, ll machine)
{
vector<vi> schedule(days);
ll id_job = 0;
for(int i=1; i<=days; i++)
{
for(int cur_machine=0; cur_machine<machine; cur_machine++)
{
if (jobs[id_job].fi > i) break;
if (jobs[id_job].fi + delay >= i)
{
schedule[i - 1].pb(jobs[id_job++].se);
} else return make_pair(false, schedule);
if (id_job == number_jobs) return make_pair(true, schedule);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...