Submission #937889

#TimeUsernameProblemLanguageResultExecution timeMemory
937889danikoynovTeams (IOI15_teams)C++14
Compilation error
0 ms0 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; struct segment { ll l, r; segment(ll _l = 0, ll _r = 0) { l = _l; r = _r; } }; const ll maxn = 5e5 + 10; ll n; segment s[maxn]; void init(ll N, ll A[], ll B[]) { n = N; for (ll i = 1; i <= n; i ++) { s[i] = segment(A[i - 1], B[i - 1]); } } ll zeta(ll a, ll b) { ll cnt = 0; for (ll i = 1; i <= n; i ++) { if (s[i].l <= a && s[i].r >= a) continue; if (s[i].l <= b && s[i].r >= b) cnt ++; } return cnt; } ll dp[maxn]; ll can(ll M, ll K[]) { for (ll i = 0; i < M; i ++) { dp[i] = zeta(0, K[i]) - K[i]; for (ll j = 0; j < i; j ++) { dp[i] = min(dp[i], dp[j] + zeta(K[j], K[i]) - K[i]); } if (dp[i] < 0) return 0; } return 1; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccHnN9zR.o: in function `main':
grader.c:(.text.startup+0x88): undefined reference to `init(int, int*, int*)'
/usr/bin/ld: grader.c:(.text.startup+0x242): undefined reference to `can(int, int*)'
collect2: error: ld returned 1 exit status