Submission #1148899

#TimeUsernameProblemLanguageResultExecution timeMemory
1148899santi3223Holiday (IOI14_holiday)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define vl vector<ll> #define vs vector<string> #define vb vector<bool> #define vc vector<char> #define ull unsigned long long #define pll pair<ll, ll> #define pb push_back #define fi first #define se second #define ff(i, p, x) for(ll i = p; i < x; i++) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define ed "\n" #define IO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll MOD = 1e9+7; ll findMaxAttraction(ll n, ll start, ll d, vl& attraction){ ll maxx = 0; for(ll l = start; l >= 0; l--){ priority_queue<ll> qq; ll c = 0; ff(r, l, n){ qq.push(-attraction[r]); c += attraction[r]; if(r < start){ continue; } ll habi = d-min(start-2*l+r, 2*r-start-l); if(habi <= 0){ break; } while(qq.size() > habi){ //restando los menores q.size()-habi elementos de c c += qq.top(); qq.pop(); } maxx = max(maxx, c); } } return maxx; } //gracias agus /* int main(){ IO ll n, s, d; cin >> n >> s >> d; vl attraction(n); ff(i, 0, n){ cin >> attraction[i]; } cout << findMaxAttraction(n, s, d, attraction); return 0; } */

Compilation message (stderr)

/usr/bin/ld: /tmp/ccQzYQEv.o: in function `main':
grader.cpp:(.text.startup+0xaf): undefined reference to `findMaxAttraction(int, int, int, int*)'
collect2: error: ld returned 1 exit status