# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
507537 | Christopher_ | Job Scheduling (CEOI12_jobs) | C++17 | 938 ms | 52876 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.
/**
* author: lani
* created: 12.01.2022 20:57:54
**/
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include "debug.hpp"
#else
#define dbg(...) void(37)
#endif
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, d, m;
cin >> n >> d >> m;
set<pair<int,int>> s;
for (int i = 0; i < m; ++i) {
int tmp;
cin >> tmp;
s.insert({tmp, i});
}
int mn = 1;
int cnt = 1;
for (auto [x, y] : s) {
int res = cnt / (x + 2);
if (cnt % (x + 2)) {
++res;
}
mn = max(mn, res);
}
cout << mn << '\n';
cnt = 0;
int list = 1;
for (auto [x, y] : s) {
++cnt;
if (cnt == 3) {
cout << 0 << '\n';
++list;
cnt = 1;
cout << y + 1 << ' ';
} else {
cout << y + 1 << ' ';
}
}
if (m % mn) {
cout << 0 << '\n';
}
for (; list <= n; ++list) {
cout << "0\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |