제출 #876281

#제출 시각아이디문제언어결과실행 시간메모리
876281Halfjuice디지털 회로 (IOI22_circuit)C++17
컴파일 에러
0 ms0 KiB
#include <vector>
 
struct _Node {
  _Node* parent;
  std::vector<_Node*> children;
} Node;
 
void init(int N, int M, int* P, int* A) {
  Node* nodes = new Node[N+M];
  for (int i=0; i<N+M; i++) {
    nodes[i].parent = nodes+P[i];
    nodes[P[i]].children.push_back(nodes+i);
  }
}
 
int count_ways(int L, int R) {
  return 0;
}

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

circuit.cpp: In function 'void init(int, int, int*, int*)':
circuit.cpp:9:9: error: 'nodes' was not declared in this scope
    9 |   Node* nodes = new Node[N+M];
      |         ^~~~~
circuit.cpp:9:21: error: 'Node' does not name a type
    9 |   Node* nodes = new Node[N+M];
      |                     ^~~~