# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
677194 | sofija6 | Job Scheduling (CEOI12_jobs) | C++14 | 304 ms | 27320 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 ll int
#define MAXM 1000002
using namespace std;
ll n,d,m;
pair<ll,ll> a[MAXM];
bool Check(ll x)
{
for (ll i=1;i<=x;i++)
{
ll cur=1;
for (ll j=1;j<=m;j+=x)
{
if (cur<a[j].first)
cur=a[j].first;
if (cur-a[j].first>d)
return false;
cur++;
}
}
return true;
}
int main()
{
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
cin >> n >> d >> m;
for (ll i=1;i<=m;i++)
{
cin >> a[i].first;
a[i].second=i;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |