# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
597420 | AryamanRtunjay | Job Scheduling (CEOI12_jobs) | C++17 | 0 ms | 0 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 <stdio.h>
#define maxN 100001
using namespace std;
struct Cell {
int id; Cell* next;
};
Cell* Req[maxN];
int Cn[maxN], m, n, d;
bool Test(int k)
{
int dd = 1, r = 0;
for(int x = 1; x<=n; x++)
{
if(Cn[x] == 0) continue;
if(dd<x-d) {dd=x-d; r=0;}
dd+=(Cn[x] + r)/k;
r = (Cn[x]+r%k);
if(dd>x+1 || dd == x+1 && r>0) return false;
}
return true;
}