제출 #83101

#제출 시각아이디문제언어결과실행 시간메모리
83101vex친구 (IOI14_friend)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define maxn 100005 #define pii pair<int,int> #define h first #define p second using namespace std; int n,br; int c[maxn]; int idx[maxn]; vector<int>adj[maxn]; int h[maxn],p[maxn]; /** 0 - IAmYourFriend 1 - MyFriendsAreYourFriends 2 - WeAreYourFriends **/ int sz[maxn]; int p[maxn]; int build() { for(int i=0;i<n;i++) { sz[i]=1; p[i]=i; } } int par(int x) { if(x!=p[x])return p[x]=par(p[x]); return x; } void unite(int x,int y) { x=par(x); y=par(y); if(x==y)return; if(sz[x]<sz[y])swap(x,y); sz[x]+=sz[y]; p[y]=x; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cerr.tie(nullptr); cin>>n; for(int i=0;i<n;i++)cin>>c[i]; for(int i=0;i<n;i++)cin>>h[i]>>p[i]; build(); for(int i=n-1;i>=0;i--) { if(p[i]==0) { adj[i].push_back(h[i]); adj[h[i]].push_back(i); } else if(p[i]==1) { } else { } } return 0; }

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

friend.cpp:21:11: error: redefinition of 'int second [100005]'
 int p[maxn];
           ^
friend.cpp:5:11: note: 'int second [100005]' previously declared here
 #define p second
           ^
friend.cpp:12:13: note: in expansion of macro 'p'
 int h[maxn],p[maxn];
             ^
friend.cpp: In function 'int build()':
friend.cpp:29:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^