# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
991916 | 2024-06-03T11:57:47 Z | elesis | Job Scheduling (IOI19_job) | C++14 | 0 ms | 0 KB |
#include <bits/stdc++.h> using namespace std; int scheduling_cost(vector<int> p, vector<int> u, vector<int> d) { int t = 0 ; int n = p.size(); int ans = 0; for(int i=0;i<n;i++) { ans += t*u[i]; t+=d[i]; } return ans; } int main() { int n; cin>>n; vector <int> p(n),u(n),d(n); for(int i=0;i<n;i++) { cin>>p[i]>>u[i]>>d[i]; } //cout << p[1] << "\n"; cout << scheduling_cost(p,u,d) << "\n"; return 0; }