Submission #267113

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2671132020-08-15 20:40:42SortingJob Scheduling (CEOI12_jobs)C++17
0 / 100
96 ms11224 KiB
#include <bits/stdc++.h>
using namespace std;
const int k_N = 1e5 + 3;
const int k_M = 1e6 + 3;
int n, d, m;
vector<int> jobs[k_N];
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> d >> m;
for(int i = 1; i <= m; ++i){
int x;
cin >> x;
jobs[x].push_back(x);
}
int ans = 0, sum = 0;
for(int i = 1; i <= n - d; ++i){
sum += jobs[i].size();
ans = max(ans, sum / (i + d) + (bool)(sum % (i + d)));
}
cout << ans << "\n";
}
/*
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...