# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1156883 | goulthen | Job Scheduling (CEOI12_jobs) | C++20 | 185 ms | 21852 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define dl long double
#define rep(i,a,b) for (auto i = a; i <= b; ++i)
#define per(i,a,b) for (auto i = a; i >= b; --i)
#define pii pair<int,int>
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define fi first
#define se second
const int MAXN = 1e5 + 10;
int a[MAXN], pfx[MAXN];
void solve() {
int n,m,d;
cin >> n >> d >> m;
vector<pii> t;
rep(i,1,m) {
int x;
cin >> x;
a[x]++;
t.pb({x,i});
}
rep(i,1,n) pfx[i] = pfx[i-1] + a[i];
sort(all(t));
int l = 1, r = m, ans = 0;
while (l <= r) {
int mid = r-(r-l)/2;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |