# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
567650 | gcconure | Job Scheduling (CEOI12_jobs) | C++17 | 1054 ms | 45664 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
int n,m,d; cin >> n >> d >> m;
multiset<pair<int,int>> v;
for(int i = 0; i < m; i++){
int x; cin >> x;
v.insert({x,i});
}
int machines = 0;
vector<int> days[n+1];
while(!v.empty()){
machines++;
int day = 0;
while(day<=n){
day++;
auto a = v.lower_bound({day-d,1000000});
days[day].push_back((*a).second);
if(a==end(v)){
break;
}
v.erase(v.lower_bound(*a));
}
}
cout << machines << "\n";
for(int i = 1; i <=n; i++){
for(int j:days[i]){
cout << j+1 << " ";
}
cout << 0;
cout << "\n";
}
// cout << machines << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |