Submission #349601

# Submission time Handle Problem Language Result Execution time Memory
349601 2021-01-18T01:32:28 Z thecodingwizard Job Scheduling (IOI19_job) C++17
0 / 100
1 ms 384 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 = u[0];
    ll ans = u[0]*d[0];

    vector<int> indices; for (int i = 1; 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 0 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 0 ms 364 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 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -