Submission #63911

# Submission time Handle Problem Language Result Execution time Memory
63911 2018-08-03T06:53:00 Z Kubalionzzale Boxes with souvenirs (IOI15_boxes) C++14
Compilation error
0 ms 0 KB
 long long int sumright = p[here], leftright = -1;
    cur = k - 1;

    for (int i = here + 1; i < n; ++i)
    {
        if (cur == 0)
        {
            sumright += p[i - 1] + p[i] * 1LL;
            cur = k - 1;
        }
        else
        {
            sumright += p[i - 1] - p[i] * 1LL;
            --cur;
        }
    }

    sumright += p[n - 1] * 1LL;

Compilation message

boxes.cpp:1:27: error: 'p' was not declared in this scope
  long long int sumright = p[here], leftright = -1;
                           ^
boxes.cpp:1:29: error: 'here' was not declared in this scope
  long long int sumright = p[here], leftright = -1;
                             ^~~~
boxes.cpp:2:5: error: 'cur' does not name a type; did you mean 'char'?
     cur = k - 1;
     ^~~
     char
boxes.cpp:4:5: error: expected unqualified-id before 'for'
     for (int i = here + 1; i < n; ++i)
     ^~~
boxes.cpp:4:28: error: 'i' does not name a type
     for (int i = here + 1; i < n; ++i)
                            ^
boxes.cpp:4:35: error: expected unqualified-id before '++' token
     for (int i = here + 1; i < n; ++i)
                                   ^~
boxes.cpp:18:5: error: 'sumright' does not name a type
     sumright += p[n - 1] * 1LL;
     ^~~~~~~~