제출 #1313292

#제출 시각아이디문제언어결과실행 시간메모리
1313292pushpita$ah@Pyramids (IOI24_pyramids)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; static vector<int> dupA, DupB; void init(vector<int> A, vector<int> B) { DupA = A; DupB = B; } bool can_transform(int l, int r, int x, int y) { l--; r--; x--; y--; long long sumA = 0, sumB = 0; for(int i = l; i <= r; i++){ sumA += DupA[i]; } for(int i = x; i <= y; i++){ sumB += DupB[i]; } return sumA == sumB; }

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

pyramids.cpp: In function 'void init(std::vector<int>, std::vector<int>)':
pyramids.cpp:7:5: error: 'DupA' was not declared in this scope; did you mean 'dupA'?
    7 |     DupA = A;
      |     ^~~~
      |     dupA
pyramids.cpp: In function 'bool can_transform(int, int, int, int)':
pyramids.cpp:17:17: error: 'DupA' was not declared in this scope; did you mean 'dupA'?
   17 |         sumA += DupA[i];
      |                 ^~~~
      |                 dupA