凌艺樽 • 1个月前
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=2e3+10;
int n,m,p,l,dp[N];
struct Node{
int x,y;
}a[N];
bool cmp(Node f,Node g)
{
return (f.x==g.x?f.y<g.y:f.x<g.x);
}
signed main()
{
scanf("%lld%lld%lld",&n,&m,&p);
for(int i=1;i<=p;++i)
{
scanf("%lld%lld",&a[i].x,&a[i].y);
}
sort(a+1,a+p+1,cmp);
dp[++l]=a[1].y;
for(int i=2;i<=p;++i)
{
if(a[i].y>dp[l])
{
dp[++l]=a[i].y;
}
else
{
int upd=lower_bound(dp+1,dp+l+1,a[i].y)-dp;
dp[upd]=a[i].y;
}
}
cout<<round( n*100.0 - l*200.0 + m*100 + 100.0*l*sqrt(2) );
return 0;
}
评论: