# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
543109 | Saeed_247 | Job Scheduling (CEOI12_jobs) | C++14 | 222 ms | 16896 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;
const int N = 1e5 + 10;
int n, m, d, arr[N];
vector<int> adj[N];
bool check(int x) {
queue<int> st;
int delay = 0;
for (int i = 1; i <= n; i++) {
for (int j = 0; j < arr[i]; j++) st.push(i);
int t = st.size();
for (int j = 0; j < min(x, t); j++) {
delay = max(delay, abs(i - st.front()));
st.pop();
}
}
if (!st.empty()) {
return false;
}
return delay <= d;
}
void print(int x) {
queue<int> st;
for (int i = 1; i <= n; i++) {
for (int j = 0; j < arr[i]; j++) st.push(adj[i][j]);
int t = st.size();
for (int j = 0; j < min(x, t); j++) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |