catinatree.cpp: In function 'std::deque<int> d(int)':
catinatree.cpp:3:147: warning: comparison of integer expressions of different signedness: 'int' and 'std::deque<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
3 | using namespace std;int N,D,x,i;deque<int>c[200000];deque<int>d(int u){deque<int>q(1,1);for(int v:c[u]){auto a=d(v);if(q.z<a.z)swap(q,a);for(x=0;x<a.z;x++)q[x]=max({q[x],a[x]+(D-x<q.z?q[max(D-x,x)]:0),q[x]+(D-x<a.z?a[max(D-x,x)]:0)});for(x=min(a.z+2,q.z);--x;)q[x-1]=max(q[x-1],q[x]);}q.push_front(q.front());return q;}int main(){cin>>N>>D;for(i=1;i<N;i++){cin>>x;c[x].push_back(i);}cout<<d(0)[0];}
| ^
catinatree.cpp:3:180: warning: comparison of integer expressions of different signedness: 'int' and 'std::deque<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
3 | using namespace std;int N,D,x,i;deque<int>c[200000];deque<int>d(int u){deque<int>q(1,1);for(int v:c[u]){auto a=d(v);if(q.z<a.z)swap(q,a);for(x=0;x<a.z;x++)q[x]=max({q[x],a[x]+(D-x<q.z?q[max(D-x,x)]:0),q[x]+(D-x<a.z?a[max(D-x,x)]:0)});for(x=min(a.z+2,q.z);--x;)q[x-1]=max(q[x-1],q[x]);}q.push_front(q.front());return q;}int main(){cin>>N>>D;for(i=1;i<N;i++){cin>>x;c[x].push_back(i);}cout<<d(0)[0];}
| ^
catinatree.cpp:3:211: warning: comparison of integer expressions of different signedness: 'int' and 'std::deque<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
3 | using namespace std;int N,D,x,i;deque<int>c[200000];deque<int>d(int u){deque<int>q(1,1);for(int v:c[u]){auto a=d(v);if(q.z<a.z)swap(q,a);for(x=0;x<a.z;x++)q[x]=max({q[x],a[x]+(D-x<q.z?q[max(D-x,x)]:0),q[x]+(D-x<a.z?a[max(D-x,x)]:0)});for(x=min(a.z+2,q.z);--x;)q[x-1]=max(q[x-1],q[x]);}q.push_front(q.front());return q;}int main(){cin>>N>>D;for(i=1;i<N;i++){cin>>x;c[x].push_back(i);}cout<<d(0)[0];}
| ^