/ Randle /

记录详情

Time Exceeded


  
# 状态 耗时 内存占用
#1 Accepted 3ms 308.0 KiB
#2 Wrong Answer 1ms 312.0 KiB
#3 Accepted 2ms 312.0 KiB
#4 Time Exceeded ≥1006ms ≥316.0 KiB
#5 Time Exceeded ≥1008ms ≥316.0 KiB
#6 Time Exceeded ≥1006ms ≥320.0 KiB
#7 Time Exceeded ≥1006ms ≥316.0 KiB
#8 Time Exceeded ≥1007ms ≥320.0 KiB
#9 Time Exceeded ≥1017ms ≥316.0 KiB
#10 Time Exceeded ≥1007ms ≥440.0 KiB

代码

#include<bits/stdc++.h>
const int maxn=1001;
inline const void read(int &a)
{
	a=0;
	char c=getchar();
	while(c<'0'||c>'9')c=getchar();
	while(c>='0'&&c<='9')
	{
		a=(a<<1)+(a<<3)+c-'0';
		c=getchar();
	}
}
struct point
{
	int x,y;
}p[maxn];
int c,n,ans=INT_MAX;
void get(int i,int step,int up,int down,int left,int right)
{
	if(step==c)
	{
		ans=std::min(ans,std::max(up-down,right-left));
		return;
	}
	if(c-step>n-i)return ;
	get(i+1,step,up,down,left,right);
	get(i+1,step+1,std::max(up,p[i].y),std::min(down,p[i].y),
				   std::min(left,p[i].x),std::max(right,p[i].x));
}
int main()
{
	read(c);read(n);
	for(int i=1;i<=n;i++){read(p[i].x);read(p[i].y);}
	get(1,0,1,10001,10001,1);
	std::cout<<ans+1;
	return 0;
}

信息

递交者
类型
递交
题目
正方形 T2
题目数据
下载
语言
C++
递交时间
2017-10-04 15:17:53
评测时间
2017-10-04 15:17:53
评测机
分数
20
总耗时
≥7069ms
峰值内存
≥440.0 KiB