# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
828350 | RaresFelix | Let's Win the Election (JOI22_ho_t3) | C++17 | 536 ms | 984740 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MN = 501;
const double INF = 1e18;
struct stat {
double a, b;
bool operator < (const stat &rhs) const {
return tie((b < 0) ? INF : b, a) < tie((rhs.b < 0) ? INF : rhs.b, rhs.a);
}
} A[MN];
int n, k;
double DP[MN][MN][MN];
int main() {
cin >> n >> k;
for(int i = 0; i <= n; ++i)
for(int j = 0; j <= n; ++j)
for(int w = 0; w <= k; ++w)
DP[i][j][w] = INF;
for(int i = 1; i <= n; ++i) {
cin >> A[i].a >> A[i].b;
}
sort(A + 1, A + n + 1);
DP[0][1][0] = 0;
for(int i = 0; i < n; ++i) {
for(int j = 1; j <= n; ++j) {
for(int w = 0; w <= k; ++w) {
///propag (i, j, w) in orasul i + 1
DP[i + 1][j][w] = min(DP[i + 1][j][w], DP[i][j][w]);
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |