제출 #63911

#제출 시각아이디문제언어결과실행 시간메모리
63911Kubalionzzale선물상자 (IOI15_boxes)C++14
컴파일 에러
0 ms0 KiB
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;

컴파일 시 표준 에러 (stderr) 메시지

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;
     ^~~~~~~~