답안 #775459

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
775459 2023-07-06T11:59:50 Z kirakaminski968 Job Scheduling (CEOI12_jobs) C++17
0 / 100
394 ms 17940 KB
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6+5;
vector<pair<int,int>> jobs(MAXN);
int N,M,D;
bool check(int x){
    for(int i = 1;i<=M;++i){
        if(i/x > jobs[i].first+D) return false;
    }
    if(M/x > N) return false;
    return true;
}
int main()
{
    cin >> N >> D >> M;
    jobs.resize(M+1);
    for(int i = 1;i<=M;++i){cin >> jobs[i].first; jobs[i].second = i;}
    sort(jobs.begin(),jobs.end());
    //for(auto p : jobs) cout << p.first << " ";
    //cout << "\n";
    int lo = 1, hi = MAXN;
    while(lo < hi){
        int mid = (lo+hi)/2;
        if(check(mid)){
            hi = mid;
        }
        else{
            lo = mid+1;
        }
    }
    cout << lo << "\n";
    int cur = 1;
    for(int i = 1;i<=M;++i){
        if(i/lo == cur+1){
            cout << "0 \n" << jobs[i].second << " ";
            cur++;
        }
        else cout << jobs[i].second << " ";
    }
    cout << "\n";
    while(cur < N){
        cout << "0\n";
        cur++;
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 34 ms 8928 KB Output isn't correct
2 Incorrect 35 ms 9020 KB Output isn't correct
3 Incorrect 34 ms 8952 KB Output isn't correct
4 Incorrect 34 ms 8940 KB Output isn't correct
5 Incorrect 33 ms 8908 KB Output isn't correct
6 Incorrect 34 ms 8940 KB Output isn't correct
7 Incorrect 46 ms 8924 KB Output isn't correct
8 Incorrect 34 ms 8908 KB Output isn't correct
9 Incorrect 41 ms 9152 KB Output isn't correct
10 Incorrect 46 ms 9068 KB Output isn't correct
11 Incorrect 41 ms 9016 KB Output isn't correct
12 Incorrect 92 ms 10164 KB Expected EOLN
13 Incorrect 129 ms 11176 KB Output isn't correct
14 Incorrect 180 ms 12720 KB Expected EOLN
15 Incorrect 214 ms 13348 KB Output isn't correct
16 Incorrect 255 ms 15060 KB Expected EOLN
17 Incorrect 313 ms 16300 KB Output isn't correct
18 Incorrect 322 ms 16632 KB Output isn't correct
19 Incorrect 394 ms 17940 KB Output isn't correct
20 Incorrect 304 ms 16196 KB Output isn't correct