# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
729309 | tch1cherin | Let's Win the Election (JOI22_ho_t3) | C++17 | 2570 ms | 1992 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const long double INF = 1e18;
void solve() {
int n, k;
cin >> n >> k;
vector<int> a(n), b(n);
for (int i = 0; i < n; i++) {
cin >> a[i] >> b[i];
}
vector<int> order(n);
iota(order.begin(), order.end(), 0);
sort(order.begin(), order.end(), [&](int i, int j) {
return b[i] < b[j];
});
vector<int> new_a(n), new_b(n);
for (int i = 0; i < n; i++) {
new_a[i] = a[order[i]];
new_b[i] = b[order[i]];
}
a = new_a, b = new_b;
long double ans = INF;
for (int c = 0; c <= k; c++) {
vector dp(k + 1, vector<long double>(c + 1, INF));
dp[0][0] = 0;
for (int i = 0; i < n; i++) {
vector new_dp(n + 1, vector<long double>(c + 1, INF));
for (int j = 0; j <= k; j++) {
# | 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... |