제출 #1165957

#제출 시각아이디문제언어결과실행 시간메모리
1165957inesPyramids (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 = A; pyramidsB = B; } bool can_transform(int L, int R, int X, int Y) { long long sumA=accumulate(pyramidsA.begin()+L,pyramids.begin()+R+1,0); long long sumB=accumulate(pyramidsA.begin()+X,pyramids.begin()+Y+1,0); if (sumA != sumB) { return false; } else{ return true; } }

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

pyramids.cpp: In function 'bool can_transform(int, int, int, int)':
pyramids.cpp:14:51: error: 'pyramids' was not declared in this scope; did you mean 'pyramidsB'?
   14 |     long long sumA=accumulate(pyramidsA.begin()+L,pyramids.begin()+R+1,0);
      |                                                   ^~~~~~~~
      |                                                   pyramidsB