제출 #225594

#제출 시각아이디문제언어결과실행 시간메모리
225594AmineWeslati열대 식물원 (Tropical Garden) (IOI11_garden)C++17
컴파일 에러
0 ms0 KiB
//#pragma GCC optimize("O3") #include <bits/stdc++.h> #include "garden.h" #include "gardenlib.h" using namespace std; #define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) //mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); typedef string str; typedef long long ll; #define int ll typedef double db; typedef long double ld; typedef pair<int,int> pi; #define mp make_pair #define fi first #define se second typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<ll> vl; typedef vector<db> vd; typedef vector<str> vs; typedef vector<pi> vpi; #define pb push_back #define eb emplace_back #define pf push_front #define lb lower_bound #define ub upper_bound #define sz(x) (int)x.size() #define all(x) begin(x), end(x) const int MOD = 1e9+7; //998244353 const ll INF = 1e18; const int nx[4]={0,0,1,-1}, ny[4]={1,-1,0,0}; const int MXN=150000+1; int N, M, P, R[MAXN][2], Q, G[2001]; int ans; int V,E,D; vpi g[MXN]; int num; vi p; void dfs(int u, int c){ if(c==num && u==D){ans++; return;} if(c==num) return; int mx=0,v=-1; for (auto x: g[u]){ if(g[u].size()==1){ v=x.fi; break;} if(x.se>mx && p[u]!=x.fi){mx=x.se; v=x.fi;} } p[v]=u; dfs(v,c+1); return; } void count_routes(int N, int M, int P, int R[][2], int Q, int G[]){ V=N; E=M; D=P; int w=E; for (int i=0; i<E; i++){ int a=R[i][0],b=R[i][1]; g[a].pb({b,w}); g[b].pb({a,w}); w--; } for (int q=0; q<Q; q++){ ans=0; num=G[q]; for (int i=0; i<V; i++){p.assign(V,-1); dfs(i,0);} answer(ans); } }

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

garden.cpp:43:16: error: 'MAXN' was not declared in this scope
 int N, M, P, R[MAXN][2], Q, G[2001];
                ^~~~
garden.cpp:43:16: note: suggested alternative: 'MXN'
 int N, M, P, R[MAXN][2], Q, G[2001];
                ^~~~
                MXN