# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
994251 | vjudge1 | Sightseeing in Kyoto (JOI22_kyoto) | C++17 | 428 ms | 1048576 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <algorithm>
#include <climits>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
struct s {
ll pos, value;
bool operator <(s const& rhs) const {
return pos < rhs.pos;
}
};
ll solve(vector<s> const& a, vector<s> const& b) {
vector dp(a.size(), vector<ll>(b.size(), LLONG_MAX / 3));
dp[0][0] = 0;
for (int i = 0; i < a.size(); i++) {
for (int j = 0; j < b.size(); j++) {
if (i < a.size() - 1)
dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + b[j].value * (a[i + 1].pos - a[i].pos));
if (j < b.size() - 1)
dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + a[i].value * (b[j + 1].pos - b[j].pos));
}
}
컴파일 시 표준 에러 (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... |