답안 #125661

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
125661 2019-07-06T07:38:54 Z faustaadp 사다리꼴 (balkan11_trapezoid) C++17
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
typedef long long int;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
int n,i,ta,tb,tc,td,j,h1,h2,d[101010];
vector<int> v[101010];
pair<pair<int,int>,pair<int,int> > A[101010];
int depe(int aa)
{
	if(d[aa]==-1)
	{
		d[aa]=0;
		int ii;
		for(ii=0;ii<v[aa].size();ii++)
			d[aa]=max(d[aa],depe(v[aa][ii]));
		d[aa]++;
	}
	return d[aa];
}
int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n;
	for(i=1;i<=n;i++)
	{
		cin>>ta>>tb>>tc>>td;
		A[i]=mp(mp(ta,tb),mp(tc,td));
	}
	for(i=1;i<=n;i++)
		for(j=1;j<=n;j++)
			if(A[i].fi.se<A[j].fi.fi&&A[i].se.se<A[j].se.fi)
				v[i].pb(j);
	memset(d,-1,sizeof(d));
	for(i=1;i<=n;i++)
		h1=max(h1,depe(i));
	cout<<h1<<" "<<h2<<"\n";	
}

Compilation message

trapezoid.cpp:2:19: error: declaration does not declare anything [-fpermissive]
 typedef long long int;
                   ^~~
trapezoid.cpp: In function 'int depe(int)':
trapezoid.cpp:17:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(ii=0;ii<v[aa].size();ii++)
            ~~^~~~~~~~~~~~~