Submission #314840

# Submission time Handle Problem Language Result Execution time Memory
314840 2020-10-21T13:09:31 Z blue Job Scheduling (IOI19_job) C++17
0 / 100
1 ms 384 KB
#include "job.h"
#include <vector>
#include <algorithm>
using namespace std;

struct job
{
    int u;
    int d;
};

bool operator < (job A, job B)
{
    return A.u*B.d > B.u*A.d;
}

long long scheduling_cost(vector<int> p, vector<int> u, vector<int> d)
{
    long long res = 0;
    int n = p.size();
    job J[n-1];
    for(int i = 1; i < n; i++) J[i-1] = job{u[i], d[i]};
    sort(J, J+n-1);

    long long t = d[0];
    res += t * u[0];
    for(int i = 0; i < n; i++)
    {
        t += J[i].d;
        res += t * J[i].u;
    }
	return res;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -