제출 #349600

#제출 시각아이디문제언어결과실행 시간메모리
349600thecodingwizardJob Scheduling (IOI19_job)C++17
0 / 100
1 ms492 KiB
#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 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...