Submission #299837

# Submission time Handle Problem Language Result Execution time Memory
299837 2020-09-15T19:20:42 Z MarcoMeijer Mountains (IOI17_mountains) C++14
Compilation error
0 ms 0 KB
#include "mountains.h"
#include <bits/stdc++.h>
 
using namespace std;
 
#define REP(a,b,c) for(int a=int(b); a<int(c); a++)
#define REV(a,b,c) for(int a=int(c-1); a>=int(b); a--)
#define RE(a,b) REP(a,0,b)
#define FOR(a,b) for(auto& a:b)
#define pb push_back
#define fi first
#define se second
#define all(a) a.begin(), a.end()
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
 
const int INF=1e9;
const int MX=1e5;
const ld EPS=1e-17;
 
int cross(ii a, ii b) {return a.fi*b.se - b.se*a.fi;}
bool ccw(ii a, ii b) {return cross(a,b) >= 0;}
ii subt(ii a, ii b) {return {a.fi-b.fi, a.se-b.se};}
bool ccw(ii A, ii B, ii C) {
    return ((B.fi - A.fi) * 1LL * (C.se - A.se) - (C.fi - A.fi) * 1LL * (B.se - A.se)) >= 0;
}

int maximum_deevs(vi y) {
    int n = y.size();
    vii C;
    RE(i,n) C.pb({i,y[i]});

    vector<vi> dp; dp.assign(n,vi(n,0));
    RE(i,n) dp[i][i] = 1;
    RE(r,n) {
        int last=r, sm=0;
        REV(l,0,r) {
            dp[l][r] = dp[l][r-1];

            if(ccw(C[l],C[last],C[r])) {
                sm += last ? dp[l+1][last-1] : 0;
                last = l;
            }

            dp[l][r] = max(dp[l][r], 1 + sm + (last ? dp[l][last-1] : 0));
        }
    }

	return dp[0][n-1];
}

#include "grader.cpp"

Compilation message

/tmp/ccdoRC6O.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccpVLkoV.o:mountains.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status