#include <bits/stdc++.h>
using namespace std;
// #define int long long
long long scheduling_cost(std::vector<int> p, std::vector<int> u, std::vector<int> d) {
int n = p.size();
long long ans=u[0]*d[0];
vector<pair<long double,int>> vec;
for(int i=1;i<n;i++)vec.emplace_back((long double)(d[i])/(long double)(u[i]),i);
sort(vec.begin(),vec.end());
long long currtime = d[0];
for(auto[a,b]:vec){
currtime+=d[b];
ans+=currtime*u[b];
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
69 ms |
16320 KB |
Output is correct |
5 |
Correct |
69 ms |
17340 KB |
Output is correct |
6 |
Correct |
69 ms |
15808 KB |
Output is correct |
7 |
Correct |
67 ms |
15140 KB |
Output is correct |
8 |
Correct |
67 ms |
16068 KB |
Output is correct |
9 |
Correct |
70 ms |
16572 KB |
Output is correct |
10 |
Correct |
73 ms |
16316 KB |
Output is correct |
11 |
Correct |
69 ms |
16840 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
4 ms |
1236 KB |
Output is correct |
6 |
Correct |
67 ms |
17080 KB |
Output is correct |
7 |
Correct |
70 ms |
16576 KB |
Output is correct |
8 |
Correct |
70 ms |
16548 KB |
Output is correct |
9 |
Correct |
66 ms |
15804 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
3 ms |
1336 KB |
Output is correct |
13 |
Correct |
4 ms |
1236 KB |
Output is correct |
14 |
Correct |
66 ms |
16940 KB |
Output is correct |
15 |
Correct |
67 ms |
17600 KB |
Output is correct |
16 |
Correct |
70 ms |
17600 KB |
Output is correct |
17 |
Correct |
69 ms |
17596 KB |
Output is correct |
18 |
Correct |
74 ms |
17476 KB |
Output is correct |
19 |
Correct |
69 ms |
16828 KB |
Output is correct |
20 |
Correct |
68 ms |
17088 KB |
Output is correct |
21 |
Correct |
70 ms |
16576 KB |
Output is correct |
22 |
Correct |
74 ms |
16572 KB |
Output is correct |
23 |
Correct |
68 ms |
16572 KB |
Output is correct |
24 |
Correct |
70 ms |
17608 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |