Submission #937888

# Submission time Handle Problem Language Result Execution time Memory
937888 2024-03-04T16:04:41 Z danikoynov Teams (IOI15_teams) C++14
Compilation error
0 ms 0 KB
#include "teams.h"

#include <bits/stdc++.h>

using namespace std;

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

teams.cpp:9:5: error: 'll' does not name a type
    9 |     ll l, r;
      |     ^~
teams.cpp:11:15: error: expected ')' before '_l'
   11 |     segment(ll _l = 0, ll _r = 0)
      |            ~  ^~~
      |               )
teams.cpp:18:7: error: 'll' does not name a type
   18 | const ll maxn = 5e5 + 10;
      |       ^~
teams.cpp:20:1: error: 'll' does not name a type
   20 | ll n;
      | ^~
teams.cpp:21:11: error: 'maxn' was not declared in this scope
   21 | segment s[maxn];
      |           ^~~~
teams.cpp:22:6: error: variable or field 'init' declared void
   22 | void init(ll N, ll A[], ll B[])
      |      ^~~~
teams.cpp:22:11: error: 'll' was not declared in this scope
   22 | void init(ll N, ll A[], ll B[])
      |           ^~
teams.cpp:22:17: error: 'll' was not declared in this scope
   22 | void init(ll N, ll A[], ll B[])
      |                 ^~
teams.cpp:22:25: error: 'll' was not declared in this scope
   22 | void init(ll N, ll A[], ll B[])
      |                         ^~
teams.cpp:32:1: error: 'll' does not name a type
   32 | ll zeta(ll a, ll b)
      | ^~
teams.cpp:45:1: error: 'll' does not name a type
   45 | ll dp[maxn];
      | ^~
teams.cpp:46:1: error: 'll' does not name a type
   46 | ll can(ll M, ll K[])
      | ^~