# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
417399 | rama_pang | Job Scheduling (IOI19_job) | C++17 | 399 ms | 74208 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "job.h"
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
lint scheduling_cost(vector<int> P, vector<int> U, vector<int> D) {
// Solution:
// Assume there is no p[]. Let's ignore u[i] * d[i].
//
// Let's observe i and j. If i < j is optimal:
// u[j] * d[i] < u[i] * d[j]
// u[j] / d[j] < u[i] / d[i]
// So, we sort by u[x] / d[x] in decreasing opt.
// With this, we can solve for a star graph.
//
// Now, assume it's a tree, and we only have 2 children.
// If the optimal ordering of the children is sorted
// decreasingly by U[i] / D[i], then we can merge the
// sorted list together.
//
// Assume we have a list = {U[i] / D[i], U[j] / D[j]} and {U[k] / D[k]}.
// Also, U[i] / D[i] < U[j] / D[j].
//
// Since j comes after i, let's ignore U[j] * D[i].
//
// Cost if {i, j, k}:
// U[k] * D[i] + U[k] * D[j]
//
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |