# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
77251 | Vardanyan | Job Scheduling (CEOI12_jobs) | C++14 | 359 ms | 21128 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.
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
const int N = 1000 * 100 + 7;
int day[N];
vector<int> g[N];
vector<int> as[N];
int main(){
int n, d, m;
scanf("%d%d%d", &n, &d, &m);
for (int i = 1; i <= m; i++){
int p;
scanf("%d", &p);
day[p]++;
g[p].push_back(i);
}
int l = 1;
int r = m;
int ans = m;
queue<int> q;
while (l <= r){
while (!q.empty()) q.pop();
int mid = (l + r) / 2;
for (int i = 1; i <= n; i++){
int x = day[i];
while (x--) q.push(i);
bool f = true;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |