답안 #316627

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
316627 2020-10-26T23:17:27 Z MetB Job Scheduling (IOI19_job) C++14
19 / 100
94 ms 10676 KB
#include "job.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace __gnu_pbds;
 
#define N 2000001
 
using namespace std;
 
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
 
const ll INF = 1e18, MOD = 1e9 + 7, MOD2 = 1e6 + 3;

int merged[N], dsu[N], n, dl[N];
ll ans;

struct rat {
	ll u, d;

	rat (ll u, ll d) : u (u), d (d) {}
	rat () {}

	bool operator < (const rat& b) const {
		return b.u * d < u * b.d;
	}

	bool operator != (const rat& b) const {
		return tie (u, d) != tie (b.u, b.d);
	}
} a[N], b[N];

ll scheduling_cost (vector <int> p, vector <int> u, vector <int> d) {
	int n = p.size ();

	for (int i = 0; i < n; i++) {
		b[i] = {u[i], d[i]};
	}

	sort (b + 1, b + n);

	ll t = 0;

	for (int i = 0; i < n; i++) {
		t += b[i].d;
		ans += b[i].u * t;
	}

	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 93 ms 8184 KB Output is correct
5 Correct 89 ms 9868 KB Output is correct
6 Correct 81 ms 10008 KB Output is correct
7 Correct 85 ms 9976 KB Output is correct
8 Correct 81 ms 9848 KB Output is correct
9 Correct 82 ms 9848 KB Output is correct
10 Correct 81 ms 9848 KB Output is correct
11 Correct 83 ms 9976 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 5 ms 768 KB Output is correct
6 Correct 90 ms 10488 KB Output is correct
7 Correct 94 ms 10488 KB Output is correct
8 Correct 90 ms 10488 KB Output is correct
9 Correct 92 ms 10492 KB Output is correct
10 Correct 1 ms 256 KB Output is correct
11 Correct 1 ms 384 KB Output is correct
12 Correct 6 ms 896 KB Output is correct
13 Correct 5 ms 768 KB Output is correct
14 Correct 91 ms 10540 KB Output is correct
15 Correct 92 ms 10488 KB Output is correct
16 Correct 91 ms 10488 KB Output is correct
17 Correct 92 ms 10620 KB Output is correct
18 Correct 91 ms 10616 KB Output is correct
19 Correct 91 ms 10520 KB Output is correct
20 Correct 92 ms 10676 KB Output is correct
21 Correct 93 ms 10492 KB Output is correct
22 Correct 91 ms 10616 KB Output is correct
23 Correct 91 ms 10488 KB Output is correct
24 Correct 92 ms 10488 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -