답안 #791441

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
791441 2023-07-24T06:34:32 Z I_FloPPed21 Job Scheduling (CEOI12_jobs) C++14
0 / 100
19 ms 1084 KB
#include <bits/stdc++.h>

using namespace std;

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

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

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

    }

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

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

    sort ( v + 1, v +n + 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;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Incorrect 2 ms 276 KB Output isn't correct
3 Incorrect 2 ms 340 KB Output isn't correct
4 Incorrect 3 ms 340 KB Output isn't correct
5 Incorrect 2 ms 340 KB Output isn't correct
6 Incorrect 2 ms 340 KB Output isn't correct
7 Incorrect 2 ms 340 KB Output isn't correct
8 Incorrect 2 ms 340 KB Output isn't correct
9 Incorrect 15 ms 980 KB Output isn't correct
10 Incorrect 15 ms 1052 KB Output isn't correct
11 Incorrect 1 ms 212 KB Output isn't correct
12 Incorrect 1 ms 212 KB Output isn't correct
13 Incorrect 1 ms 212 KB Output isn't correct
14 Incorrect 2 ms 340 KB Output isn't correct
15 Incorrect 1 ms 212 KB Output isn't correct
16 Incorrect 3 ms 340 KB Output isn't correct
17 Incorrect 3 ms 340 KB Output isn't correct
18 Incorrect 2 ms 340 KB Output isn't correct
19 Incorrect 19 ms 1084 KB Output isn't correct
20 Incorrect 3 ms 340 KB Output isn't correct