# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
740771 | bleu | Job Scheduling (CEOI12_jobs) | C++14 | 135 ms | 13552 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;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, d, m;
cin >> n >> d >> m;
vector<vector<int>> J(n);
for(int i=0; i<m; i++) {
int c; cin >> c;
J[c-1].push_back(i+1);
}
int lo=0, hi=m;
while(lo < hi) {
int mid = (lo + hi) / 2;
int t = 0;
int rem=mid;
bool works=true;
for(int i=0; i<n && works; i++) {
int count = J[i].size();
count -= rem;
t++;
rem=mid;
if(count<0) continue;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |