# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
642591 | accidentac | Job Scheduling (CEOI12_jobs) | C++17 | 375 ms | 23232 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int n, d, m;
vector<array<int, 2>> jobs;
// return true if can use count no. of machines to handle all jobs
bool ok(int count) {
queue<int> q;
for (int i = 1, j = 0; i <= n; i++) {
while (j < m && jobs[j][0] == i) {
q.push(j++);
}
if (q.size() && i - jobs[q.front()][0] > d) return false;
for (int rep = 0; rep < count && !q.empty(); rep++) {
q.pop();
}
}
return true;
}
vector<vector<int>> form(int count) {
vector<vector<int>> ans(n);
queue<int> q;
for (int i = 1, j = 0; i <= n; i++) {
vector<int> cur;
while (j < m && jobs[j][0] == i) {
q.push(j++);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |