Submission #37484

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
374842017-12-26 02:41:36MatheusLealVBuilding Bridges (CEOI17_building)C++14
100 / 100
303 ms10784 KiB
// Building bridges - CEOI 2017
// Complexidade O(N*sqrt(N))
#include <bits/stdc++.h>
#define inf 2000000000000000000LL
#define N 100050
#define f first
#define s second
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
vector<pii> lines;
ll h[N], sum[N], n, dp[N], raiz;
struct Convex_Hull
{
vector<pii> lines;
double intersect(pii r, pii s)
{
return ((double)(r.s - s.s))/((double)(s.f - r.f));
}
bool bad(pii A, pii B, pii C)
{
return intersect(A, C) <= intersect(B, A);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

building.cpp: In function 'void Clear_Stack()':
building.cpp:81:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while(esq < oficial.lines.size() && dir < pilha.lines.size())
             ^
building.cpp:81:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while(esq < oficial.lines.size() && dir < pilha.lines.size())
                                           ^
building.cpp:88:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while(esq < oficial.lines.size()) aux.addline(oficial.lines[esq], 1), esq ++;
             ^
building.cpp:90:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while(dir < pilha.lines.size()) aux.addline(pilha.lines[dir], 1), dir ++;
             ^
building.cpp: In function 'int main()':
building.cpp:121:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if(pilha.lines.size() >= raiz) Clear_Stack();
                             ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...