# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
935449 | weakweakweak | Collecting Stamps 3 (JOI20_ho_t3) | C++14 | 68 ms | 145556 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//自己想到的,好開心(對照過提解了,確定是對的)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, l, a[210], t[210];
ll inf = 1e13;
ll dp[210][210][210][2]; //dp[l][r][k][w]代表逆時針走過l,順時針走過r,共拿過k個郵票,現在在哪個端點(w=0是左),所需的最短時間
int walk (int st, int ed) {
if (st == ed) return 0;
if (st > ed) swap(st, ed);
return min((a[st] + l - a[ed]), a[ed] - a[st]);
}
signed main () {
ios_base::sync_with_stdio(false); cin.tie(0);
memset(dp, 63, sizeof(dp));
dp[0][0][0][0] = dp[0][0][0][1] = 0;
cin >> n >> l;
for (int i = 1; i <= n; i++) cin >> a[i];
for (int i = 1; i <= n; i++) cin >> t[i];
a[0] = 0, a[n + 1] = l, t[0] = t[n + 1] = -1;
int ans = 0;
for (int l = 0; l <= n; l++) {
for (int r = 0; r <= n and l + r <= n; r++) {
for (int k = 0; k <= n; k++) {
if (min(dp[l][r][k][1], dp[l][r][k][0]) < inf) {
# | 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... |