제출 #1165967

#제출 시각아이디문제언어결과실행 시간메모리
1165967inesPyramids (IOI24_pyramids)C++20
컴파일 에러
0 ms0 KiB
#include <vector>
#include<numeric>
using namespace std;

vector<int> pyramidsA, pyramidsB;

void init(vector<int> A, vector<int> B) {
    pyramidsA = move(A);
    pyramidsB = move(B);
}

bool can_transform(int L, int R, int X, int Y) {

    return accumulate(pyramidsA.begin()+L,pyramidsA.begin()+R+1,0LL)==
      accumulate(pyramidsB.begin()+X,pyramidsB.begin()+Y+1,0LL);


    if (sumA != sumB) {
        return false;
    }
    else{

    return true;
    }
}

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

pyramids.cpp: In function 'bool can_transform(int, int, int, int)':
pyramids.cpp:18:9: error: 'sumA' was not declared in this scope
   18 |     if (sumA != sumB) {
      |         ^~~~
pyramids.cpp:18:17: error: 'sumB' was not declared in this scope
   18 |     if (sumA != sumB) {
      |                 ^~~~