Submission #453044

# Submission time Handle Problem Language Result Execution time Memory
453044 2021-08-04T07:42:41 Z BT21tata Job Scheduling (CEOI12_jobs) C++17
0 / 100
421 ms 13748 KB
#include<bits/stdc++.h>
// #pragma GCC target ("avx,avx2,fma")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
typedef long long ll;
typedef long double ld;
#define SPEED ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(0)
#define rall(v) (v).rbegin(),(v).rend()
#define all(v) (v).begin(),(v).end()
#define OK cerr<<"OK"<<endl<<flush
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define F first
#define S second
#define y0 jahdakdh
#define y1 jahsadakdakdh
#define endl '\n'
using namespace std;
const ll MOD=1e9+7;
//mt19937 rng(std::chrono::system_clock::now().time_since_epoch().count());

int n, d, m;
pii a[1000005];

bool check(int x)
{
    int day=1;
    while(day<=n)
    {
        if(day*x>n) break;
        //cout<<x<<' ' <<day<<' '<<a[day*x-1].F<<endl;
        if(a[day*x-1].F<day) return 0;
        day++;
    }
    return 1;
}

int main()
{
    SPEED;
    cin>>n>>d>>m;
    for(int i=0; i<m; i++)
    {
        cin>>a[i].F;
        a[i].F+=d;
        a[i].S=i+1;
    }
    sort(a, a+m);
    int l=1, r=m, mid, pos=0;
    while(l<=r)
    {
        mid=(l+r)>>1;
        if(check(mid)) r=mid-1;
        else l=mid+1;
    }
    cout<<l<<endl;
    for(int i=0; i<n; i++, cout<<0<<endl)
        for(int j=0; j<l and pos<m; j++)
            cout<<a[pos++].S<<' ';

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 1612 KB Output isn't correct
2 Incorrect 67 ms 1620 KB Output isn't correct
3 Incorrect 21 ms 1688 KB Output isn't correct
4 Incorrect 21 ms 1696 KB Output isn't correct
5 Incorrect 26 ms 1612 KB Output isn't correct
6 Incorrect 21 ms 1640 KB Output isn't correct
7 Incorrect 21 ms 1612 KB Output isn't correct
8 Incorrect 21 ms 1612 KB Output isn't correct
9 Incorrect 37 ms 1768 KB Output isn't correct
10 Incorrect 38 ms 1856 KB Output isn't correct
11 Incorrect 25 ms 1352 KB Output isn't correct
12 Incorrect 42 ms 1864 KB Output isn't correct
13 Incorrect 73 ms 3088 KB Output isn't correct
14 Incorrect 96 ms 4036 KB Output isn't correct
15 Incorrect 127 ms 5900 KB Output isn't correct
16 Incorrect 186 ms 8972 KB Output isn't correct
17 Incorrect 195 ms 8588 KB Output isn't correct
18 Incorrect 262 ms 12156 KB Output isn't correct
19 Incorrect 421 ms 13748 KB Output isn't correct
20 Incorrect 193 ms 8592 KB Output isn't correct