Submission #417385

# Submission time Handle Problem Language Result Execution time Memory
417385 2021-06-03T15:56:19 Z maximath_1 Job Scheduling (IOI19_job) C++17
0 / 100
253 ms 17780 KB
#include "job.h"
#include <vector>
#include <set>
#include <iostream>
using namespace std;
#define ll long long

struct job{
	int u, d, id;
	bool operator < (const job &rhs) const{
		if(d * 1ll * rhs.u == u * 1ll * rhs.d){
			return rhs.d > d;
		}
		return d * 1ll * rhs.u < u * 1ll * rhs.d;
	}
};

long long scheduling_cost(vector<int> p, vector<int> u, vector<int> d){
	int n = p.size();
	set<job> s;

	vector<int> ord;
	for(int i = 1; i < n; i ++)
		s.insert({u[i], d[i], i});

	ll ans = 0ll, tim = 0ll;
	tim += d[0]; ans += tim * u[0];

	for(auto i : s){
		tim += d[i.id];
		ans += tim * 1ll * u[i.id];
	}

	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 1 ms 256 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 7 ms 1200 KB Output is correct
6 Incorrect 253 ms 17780 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 288 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -