제출 #398696

#제출 시각아이디문제언어결과실행 시간메모리
398696Pichon5열대 식물원 (Tropical Garden) (IOI11_garden)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include <iostream> #include "garden.h" #include "gardenlib.h" #define lcm(a,b) (a/__gcd(a,b))*b #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define ll long long int #define vi vector<int> #define vll vector<ll> #define pb push_back #define F first #define S second #define mp make_pair using namespace std; void count_routes(int N, int M, int P, int R[][2], int Q, int G[]) { vi G[N]; for(int i=0;i<M;i++){ int a=R[i][0],b=R[i][1]; if(G[a].size()<2){ G[a].pb(b); } if(G[b].size()<2){ G[b].pb(a); } } int k=G[0]; int res=0; for(int i=0;i<N;i++){ int curr=i; int p=-1; for(int l=0;l<k;l++){ if(G[curr].size()==2){ if(G[curr][0]!=p){ p=curr; curr=G[nodo][0]; }else{ p=curr; curr=G[nodo][1]; } } if(G[nodo].size()==1){ curr=G[nodo][1]; } } if(curr==p){ res++; } } answer(res); }

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

garden.cpp: In function 'void count_routes(int, int, int, int (*)[2], int, int*)':
garden.cpp:17:11: error: declaration of 'std::vector<int> G [N]' shadows a parameter
   17 |     vi G[N];
      |           ^
garden.cpp:27:14: error: cannot convert 'std::vector<int>' to 'int' in initialization
   27 |     int k=G[0];
      |           ~~~^
      |              |
      |              std::vector<int>
garden.cpp:36:28: error: 'nodo' was not declared in this scope
   36 |                     curr=G[nodo][0];
      |                            ^~~~
garden.cpp:39:28: error: 'nodo' was not declared in this scope
   39 |                     curr=G[nodo][1];
      |                            ^~~~
garden.cpp:42:18: error: 'nodo' was not declared in this scope
   42 |             if(G[nodo].size()==1){
      |                  ^~~~