# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
48425 | wzy | Building Bridges (CEOI17_building) | C++11 | 149 ms | 9164 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.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
long long w[100005] , h[100005];
long long n;
long long dp[100005];
struct line{
int x , y;
line(int x , int y){
this->x = x , this->y = y;
}
};
bool operator <(line a , line b){
if(a.x == b.x) return a.y > b.y;
else return a.x > b.x;
}
template <class type>
class CHT{
public :
bool cmp(type a , type b , type c){
return ((double)((double) (c.y) - (a.y)) * ((double) (a.x) - (b.x)) <= ((double) ((double) (a.x) - (c.x)) * ((double) (b.y) - (a.y)) ) ) ;
}
int sizex(){
return cht.size();
}
void addLINE(type a){
while(cht.size() >= 2 && cmp(cht[cht.size() - 2] , cht[cht.size() - 1] , a)){
cht.pop_back();
Compilation message (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... |