| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 425637 | Tangent | Wiring (IOI17_wiring) | C++17 | 281 ms | 262148 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "wiring.h"
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vii;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vii> vvii;
typedef vector<vll> vvll;
typedef vector<vpii> vvpii;
typedef vector<vpll> vvpll;
#define ffor(i, a, b) for (ll i = (a); i < (b); i++)
#define fford(i, a, b) for (ll i = (a); i > (b); i--)
#define rep(i, n) ffor(i, 0, n)
#define forin(x, a) for (auto &x: a)
#define all(a) a.begin(), a.end()
long long min_total_length(std::vector<int> r, std::vector<int> b) {
vvll dp(r.size() + 1, vll(b.size() + 1, 1ll << 62));
dp[0][0] = 0;
ffor(tot, 2, r.size() + b.size() + 1) {
ffor(i, max(1ll, tot - (ll)b.size()), min(tot, (ll)r.size() + 1)) {
ll j = tot - i;
cerr << i << ' ' << j << '\n';
ll curr = 0;
rep(k, i) {
curr += abs(r[i - k - 1] - b[j - 1]);
dp[i][j] = min(dp[i][j], dp[i - k - 1][j - 1] + curr);
}
curr = 0;
rep(k, j) {
curr += abs(r[i - 1] - b[j - k - 1]);
dp[i][j] = min(dp[i][j], dp[i - 1][j - k - 1] + curr);
}
}
}
return dp.back().back();
}
컴파일 시 표준 에러 (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... | ||||
