# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
474191 | Lam_lai_cuoc_doi | Job Scheduling (IOI19_job) | C++17 | 105 ms | 5820 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
template <class T>
void read(T &x)
{
x = 0;
register int c;
while ((c = getchar()) && (c > '9' || c < '0'))
;
for (; c >= '0' && c <= '9'; c = getchar())
x = x * 10 + c - '0';
}
constexpr bool typetest = 0;
constexpr int N = 2e3 + 5;
constexpr int Inf = 1e9 + 7;
ll scheduling_cost(vector<int> p, vector<int> u, vector<int> d)
{
int n = p.size();
if (count(p.begin(), p.end(), 0) == n - 1)
{
vector<int> id(n);
for (int i = 0; i < n; ++i)
id[i] = i;
sort(id.begin() + 1, id.end(), [&](const int &x, const int &y)
{ return d[x] * u[y] < d[y] * u[x]; });
ll ans(0), time(0);
for (int i = 0; i < n; ++i)
{
time += d[id[i]];
//cout << id[i] << " " << time << "\n";
ans += u[id[i]] * time;
}
return ans;
}
return Inf;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |