Submission #635312

#TimeUsernameProblemLanguageResultExecution timeMemory
635312tabrJob Scheduling (IOI19_job)C++17
19 / 100
98 ms8888 KiB
#include <bits/stdc++.h> using namespace std; #ifdef tabr #include "library/debug.cpp" #else #define debug(...) #endif long long scheduling_cost(vector<int> p, vector<int> u, vector<int> d) { int n = (int) p.size(); vector<int> order(n - 1); iota(order.begin(), order.end(), 1); sort(order.begin(), order.end(), [&](int i, int j) { return d[i] * u[j] < d[j] * u[i]; }); order.insert(order.begin(), 0); long long res = 0; long long t = 0; for (int i : order) { t += d[i]; res += t * u[i]; } return res; } #ifdef tabr int main() { ios::sync_with_stdio(false); cin.tie(0); debug(scheduling_cost({-1, 0, 0}, {5, 2, 5}, {3, 4, 1})); return 0; } #endif
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...