Submission #791451

# Submission time Handle Problem Language Result Execution time Memory
791451 2023-07-24T06:39:48 Z I_FloPPed21 Job Scheduling (CEOI12_jobs) C++14
0 / 100
195 ms 7244 KB
#include <bits/stdc++.h>

using namespace std;

long long n, d, m ;
long long v [ 1000005 ];

bool check(long long caz )
{
    int ziua = 1 ;

    for ( int i = 1; i <= m ; i += caz, ziua ++  )
    {
        if ( v[ i ] < ziua )
            return false ;

    }

    return true ;
}
int main()
{
    cin >> n >> d >> m ;

    for ( int i = 1; i <= m ; i ++ )
    {
        cin >> v[ i ] ;
        v [ i ] += d ;
    }

    sort ( v + 1, v + m  + 1) ;

    long long poz = 1e9 ;

    int st = 1, dr = m ;

    while ( st <= dr )
    {
        long long mij = ( st + dr ) / 2 ;
        if ( check ( mij ) == true )
        {
            poz = mij ;
            dr = mij - 1;
        }
        else
            st = mij + 1;
    }

    cout << poz << '\n' ;



    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 1020 KB Output isn't correct
2 Incorrect 14 ms 1048 KB Output isn't correct
3 Incorrect 18 ms 980 KB Output isn't correct
4 Incorrect 13 ms 980 KB Output isn't correct
5 Incorrect 17 ms 1068 KB Output isn't correct
6 Incorrect 13 ms 996 KB Output isn't correct
7 Incorrect 13 ms 1032 KB Output isn't correct
8 Incorrect 14 ms 980 KB Output isn't correct
9 Incorrect 14 ms 980 KB Unexpected end of file - int32 expected
10 Incorrect 15 ms 980 KB Unexpected end of file - int32 expected
11 Incorrect 20 ms 980 KB Unexpected end of file - int32 expected
12 Incorrect 37 ms 1760 KB Unexpected end of file - int32 expected
13 Incorrect 69 ms 2572 KB Unexpected end of file - int32 expected
14 Incorrect 88 ms 3392 KB Unexpected end of file - int32 expected
15 Incorrect 93 ms 4196 KB Output isn't correct
16 Incorrect 135 ms 4940 KB Unexpected end of file - int32 expected
17 Incorrect 159 ms 5764 KB Unexpected end of file - int32 expected
18 Incorrect 146 ms 6544 KB Unexpected end of file - int32 expected
19 Incorrect 195 ms 7244 KB Unexpected end of file - int32 expected
20 Incorrect 181 ms 5764 KB Unexpected end of file - int32 expected