# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
43230 | 5ak0 | Building Bridges (CEOI17_building) | C++14 | 22 ms | 2660 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
ID: 5ak0
PROG:
LANG: C++11
*/
#include <bits/stdc++.h>
#define fr first
#define sc second
#define pb push_back
#define mpr make_pair
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const ll INF = 1e18 + 7;
const int MAXN = 1e5 + 10;
int n;
ll h[MAXN], w[MAXN], pre[MAXN], res = INF;
ll dist(int i, int j){
return (h[i] - h[j]) * (h[i] - h[j]);
}
ll check(int i, int j){
return pre[i - 1] - pre[1] + pre[j - 1] - pre[i] + pre[n - 1] - pre[j] + dist(1, i) + dist(i, j) + dist(j, n);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |