# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
600609 | 8e7 | Shortcut (IOI16_shortcut) | C++17 | 2086 ms | 2260 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "shortcut.h"
//Challenge: Accepted
#include <bits/stdc++.h>
using namespace std;
#ifdef zisk
void debug(){cout << endl;}
template<class T, class ... U> void debug(T a, U ... b){cout << a << " ", debug(b...);}
template<class T> void pary(T l, T r){
while (l != r) cout << *l << " ", l++;
cout << endl;
}
#else
#define debug(...) 0
#define pary(...) 0
#endif
#define ll long long
#define maxn 100005
#define pii pair<int, int>
#define ff first
#define ss second
const ll inf = 1LL<<60;
long long find_shortcut(int n, vector<int> L, vector<int> D, int c) {
vector<vector<ll> > d(2*n, vector<ll>(2*n, 0));
vector<ll> pref(n, 0);
for (int i = 0;i < n - 1;i++) pref[i+1] = pref[i] + L[i];
for (int i = 0;i < 2*n;i++) {
for (int j = i+1;j < 2*n;j++) {
ll p = pref[j/2] - pref[i/2];
if (j % 2) p += D[j/2];
if (i % 2) p += D[i/2];
d[i][j] = d[j][i] = p;
}
}
ll ans = inf;
for (int a = 0;a < 2*n;a += 2) {
for (int b = 2;b < 2*n;b += 2) {
ll val = 0;
for (int i = 0;i < 2*n;i++) {
for (int j = i+1;j < 2*n;j++) {
val = max(val, min(d[a][i] + d[b][j] + c, d[i][j]));
}
}
debug(a, b, val);
ans = min(ans, val);
}
}
return ans;
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |