#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 = d[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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
89 ms |
7908 KB |
Output is correct |
5 |
Correct |
92 ms |
8036 KB |
Output is correct |
6 |
Correct |
90 ms |
7908 KB |
Output is correct |
7 |
Correct |
92 ms |
7908 KB |
Output is correct |
8 |
Correct |
94 ms |
8164 KB |
Output is correct |
9 |
Correct |
89 ms |
7908 KB |
Output is correct |
10 |
Correct |
91 ms |
7928 KB |
Output is correct |
11 |
Correct |
90 ms |
7908 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
492 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
5 ms |
748 KB |
Output is correct |
6 |
Correct |
97 ms |
8548 KB |
Output is correct |
7 |
Correct |
97 ms |
8548 KB |
Output is correct |
8 |
Correct |
97 ms |
8548 KB |
Output is correct |
9 |
Correct |
98 ms |
8548 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |
11 |
Correct |
1 ms |
364 KB |
Output is correct |
12 |
Correct |
4 ms |
748 KB |
Output is correct |
13 |
Correct |
5 ms |
748 KB |
Output is correct |
14 |
Correct |
97 ms |
8548 KB |
Output is correct |
15 |
Correct |
97 ms |
8548 KB |
Output is correct |
16 |
Correct |
98 ms |
8548 KB |
Output is correct |
17 |
Correct |
96 ms |
8548 KB |
Output is correct |
18 |
Correct |
97 ms |
8568 KB |
Output is correct |
19 |
Correct |
98 ms |
8548 KB |
Output is correct |
20 |
Correct |
100 ms |
8568 KB |
Output is correct |
21 |
Correct |
102 ms |
8548 KB |
Output is correct |
22 |
Correct |
99 ms |
8548 KB |
Output is correct |
23 |
Correct |
97 ms |
8548 KB |
Output is correct |
24 |
Correct |
99 ms |
8548 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |