답안 #1113992

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1113992 2024-11-18T04:26:40 Z ezzzay Job Scheduling (CEOI12_jobs) C++14
40 / 100
397 ms 16804 KB
#include<bits/stdc++.h>
using namespace std;
#define itn long long
#define ff first
#define ss second
#define int long long
#define pb push_back
vector<pair<int,int>>v;
int n,d,m;
bool check(int mid){
    int j=0;
    for(int i=1;i<=n;i++){
        int p=mid;
        while(j<m and p>0){
            if(v[j].ff > i)break;
            j++;
            p--;
        }
    }
    return j==m;
}
signed main(){
    cin>>n>>d>>m;
    for(int i=1;i<=m;i++){
        int x;
        cin>>x;
        v.pb({x,i});
    }
    sort(v.begin(),v.end());
    int lo=0,hi=1e16;
    while(hi>=lo){
        int mid=(hi+lo)/2;
        bool u=check(mid);
        if(u==0){
           
            lo=mid+1;
        }
        else{
             hi=mid-1;
        }
    }
    cout<<lo<<endl;
    for(int i=1;i<=n;i++)cout<<0<<endl;
    
}
/*
8 2 12 
1 2 4 2 1 3 5 6 2 3 6 4
*/
# 결과 실행 시간 메모리 Grader output
1 Incorrect 37 ms 2500 KB Output isn't correct
2 Incorrect 33 ms 2512 KB Output isn't correct
3 Incorrect 34 ms 2500 KB Output isn't correct
4 Incorrect 34 ms 2500 KB Output isn't correct
5 Incorrect 36 ms 2500 KB Output isn't correct
6 Incorrect 32 ms 2500 KB Output isn't correct
7 Incorrect 32 ms 2500 KB Output isn't correct
8 Incorrect 32 ms 2668 KB Output isn't correct
9 Incorrect 161 ms 2500 KB Output isn't correct
10 Incorrect 162 ms 2500 KB Output isn't correct
11 Correct 27 ms 2500 KB Output is correct
12 Correct 53 ms 4508 KB Output is correct
13 Correct 80 ms 8628 KB Output is correct
14 Correct 139 ms 8628 KB Output is correct
15 Correct 131 ms 8628 KB Output is correct
16 Correct 184 ms 16796 KB Output is correct
17 Correct 244 ms 16804 KB Output is correct
18 Incorrect 228 ms 16804 KB Output isn't correct
19 Incorrect 397 ms 16796 KB Output isn't correct
20 Correct 236 ms 16804 KB Output is correct