# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
210886 | 2020-03-19T01:24:42 Z | daniel920712 | Job Scheduling (IOI19_job) | C++14 | 8 ms | 4992 KB |
#include "job.h" #include <vector> #include <queue> using namespace std; vector < int > Next[200005]; struct A { long long u,t,where; }all[200005]; bool operator > (A a,A b) { return a.u*b.t<b.u*a.t; } priority_queue < A , vector < A > , greater < A > > how; long long scheduling_cost(std::vector<int> p, std::vector<int> u, std::vector<int> d) { long long N=(long long) u.size(),ans=0,t=0,i; for(i=0;i<N;i++) { all[i].u=u[i]; all[i].t=d[i]; all[i].where=i; } for(i=1;i<N;i++) Next[p[i]].push_back(i); how.push(all[0]); while(!how.empty()) { A a=how.top(); how.pop(); t+a.t; ans+=t*a.u; for(auto i:Next[a.where]) how.push(all[i]); } return ans; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 4992 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 8 ms | 4992 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 8 ms | 4992 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 4992 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 8 ms | 4992 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 4992 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |