# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
988628 | parlimoos | Building Bridges (CEOI17_building) | C++17 | 312 ms | 7844 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//Be Name KHODA
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define pp pop_back
#define lb lower_bound
#define ub upper_bound
#define cl clear
#define bg begin
#define arr(x) array<ll , x>
#define endl '\n'
int n;
vector<ll> w , h;
ll dp[200000] , inf[200000][2];
set<arr(2)> pt;
void init(){
for(int i = 1 ; i < n ; i++) w[i] += w[i - 1];
for(int i = 0 ; i < n ; i++){
inf[i][1] = (h[i] * h[i]) , inf[i][0] = (h[i] * h[i]) - w[i];
if(i > 0) inf[i][1] += w[i - 1];
}
}
bool jg(ll c , int i , int j){
return (dp[i] - (2 * c * h[i]) <= dp[j] - (2 * c * h[j]));
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |