Submission #561990

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5619902022-05-14 03:30:14abcvuitunggioBuilding Bridges (CEOI17_building)C++17
0 / 100
40 ms3620 KiB
#include <iostream>
#include <algorithm>
#include <vector>
#define point pair <int, int>
#define fi first
#define se second
#define int long long
typedef long double ld;
using namespace std;
int n,m,dp[100001],h[100001],w[100001],c,last,sumw;
vector <point> v[18],ve[18];
bool cmp(point a, point b){
if (a.fi!=b.fi)
return a.fi<b.fi;
return a.se>b.se;
}
int ce(int a, int b){
return a/b+(a*b>0&&a/b*b!=a);
}
ld intersection(pair <int, int> p, pair <int, int> p2){
return ((ld)(p2.se-p.se))/(p.fi-p2.fi);
}
void add(pair <int, int> p, int idx){
if (!v[idx].empty()&&v[idx].back().fi==p.fi)
return;
while (v[idx].size()>1){
ld p12=intersection(v[idx][v[idx].size()-2],v[idx].back()),p13=intersection(v[idx][v[idx].size()-2],p);
if (p12<p13)
break;
v[idx].pop_back();
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...