답안 #417373

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
417373 2021-06-03T15:45:44 Z maximath_1 Job Scheduling (IOI19_job) C++17
0 / 100
7 ms 1188 KB
#include "job.h"
#include <vector>
#include <set>
using namespace std;
#define ll long long

struct job{
	int u, d, id;
	bool operator < (const job &rhs) const{
		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;
	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 * u[i.id];
	}

	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Incorrect 7 ms 1188 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 280 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -