제출 #1311566

#제출 시각아이디문제언어결과실행 시간메모리
1311566robijoyPyramids (IOI24_pyramids)C++20
컴파일 에러
0 ms0 KiB
#include "pyramids.h" // #include <bits/stdc++.h> vector<int> robi1, robi2; void init(std::vector<int> A, std::vector<int> B) { robi1 = A; robi2 = B; } bool can_transform(int L, int R, int X, int Y) { int sum1 = 0, sum2; for (int i = L; i <= R; ++i) sum1+=robi1[i]; for (int i = X; i <= Y; ++i) sum2+=robi2[i]; return (sum1==sum2); }

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

pyramids.cpp:4:1: error: 'vector' does not name a type
    4 | vector<int> robi1, robi2;
      | ^~~~~~
pyramids.cpp: In function 'void init(std::vector<int>, std::vector<int>)':
pyramids.cpp:7:5: error: 'robi1' was not declared in this scope
    7 |     robi1 = A;
      |     ^~~~~
pyramids.cpp:8:5: error: 'robi2' was not declared in this scope
    8 |     robi2 = B;
      |     ^~~~~
pyramids.cpp: In function 'bool can_transform(int, int, int, int)':
pyramids.cpp:13:38: error: 'robi1' was not declared in this scope
   13 |   for (int i = L; i <= R; ++i) sum1+=robi1[i];
      |                                      ^~~~~
pyramids.cpp:14:38: error: 'robi2' was not declared in this scope
   14 |   for (int i = X; i <= Y; ++i) sum2+=robi2[i];
      |                                      ^~~~~