#include "job.h"
#include<bits/stdc++.h>
#define pb push_back
#define ii pair<int,int>
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define INF 100000000000000000
#define modulo 1000000007
#define mod 998244353
#define int long long int
using namespace std;
int scheduling_cost(vector<int32_t> p, vector<int32_t> u, vector<int32_t> d){
int n = sz(p);
int cost = 0, t = 0;
for(int i = 0; i < n; i++) t += d[i];
vector<int> seq;
for(int i = 1; i < n; i++) seq.pb(i);
sort(all(seq), [&](int x, int y){return u[x] * d[y] < u[y] * d[x];});
seq.pb(0);
for(auto x : seq){
cost += u[x] * t;
t -= d[x];
}
return cost;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Correct |
0 ms |
256 KB |
Output is correct |
4 |
Correct |
94 ms |
8940 KB |
Output is correct |
5 |
Correct |
102 ms |
8940 KB |
Output is correct |
6 |
Correct |
97 ms |
9068 KB |
Output is correct |
7 |
Correct |
101 ms |
8972 KB |
Output is correct |
8 |
Correct |
97 ms |
8940 KB |
Output is correct |
9 |
Correct |
97 ms |
8940 KB |
Output is correct |
10 |
Correct |
98 ms |
8940 KB |
Output is correct |
11 |
Correct |
95 ms |
8964 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Correct |
0 ms |
256 KB |
Output is correct |
4 |
Correct |
1 ms |
384 KB |
Output is correct |
5 |
Correct |
6 ms |
896 KB |
Output is correct |
6 |
Correct |
113 ms |
9576 KB |
Output is correct |
7 |
Correct |
115 ms |
9584 KB |
Output is correct |
8 |
Correct |
108 ms |
9580 KB |
Output is correct |
9 |
Correct |
105 ms |
9580 KB |
Output is correct |
10 |
Correct |
0 ms |
256 KB |
Output is correct |
11 |
Correct |
1 ms |
384 KB |
Output is correct |
12 |
Correct |
5 ms |
768 KB |
Output is correct |
13 |
Correct |
8 ms |
896 KB |
Output is correct |
14 |
Correct |
105 ms |
9576 KB |
Output is correct |
15 |
Correct |
106 ms |
9580 KB |
Output is correct |
16 |
Correct |
106 ms |
9580 KB |
Output is correct |
17 |
Correct |
118 ms |
9612 KB |
Output is correct |
18 |
Correct |
106 ms |
9580 KB |
Output is correct |
19 |
Correct |
107 ms |
9580 KB |
Output is correct |
20 |
Correct |
122 ms |
9580 KB |
Output is correct |
21 |
Correct |
114 ms |
9500 KB |
Output is correct |
22 |
Correct |
107 ms |
9580 KB |
Output is correct |
23 |
Correct |
114 ms |
9580 KB |
Output is correct |
24 |
Correct |
111 ms |
9580 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |