Submission #349600

# Submission time Handle Problem Language Result Execution time Memory
349600 2021-01-18T01:31:41 Z thecodingwizard Job Scheduling (IOI19_job) C++17
0 / 100
1 ms 492 KB
#include "job.h"
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
#define pb push_back
#define all(x) x.begin(), x.end()

long long scheduling_cost(std::vector<int> p, std::vector<int> u, std::vector<int> d) {
    int n = p.size();
    ll curTime = 0;
    ll ans = 0;

    vector<int> indices; for (int i = 0; i < n; i++) indices.pb(i);
    sort(all(indices), [&d, &u](int &x, int &y) { return d[x]*u[y]<d[y]*u[x]; });

    for (auto x : indices) {
        curTime += d[x];
        ans += curTime*u[x];
    }

    return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 492 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 492 KB Output isn't correct
2 Halted 0 ms 0 KB -