64分有没有大佬帮忙看看哪里错了。。
  • 板块P2694 接金币
  • 楼主conprour
  • 当前回复2
  • 已保存回复2
  • 发布时间2020/12/13 00:06
  • 上次更新2023/11/5 06:11:54
查看原帖
64分有没有大佬帮忙看看哪里错了。。
234783
conprour楼主2020/12/13 00:06
#include<bits/stdc++.h>
using namespace std;
int g,n;
struct node
{
	int x,y;
}pos[55];
bool cmp(node b,node c)
{
	return b.y<c.y;
}
bool a[6];
int main()
{
	scanf("%d",&g);
	for(int t=1;t<=g;t++)
	{
		scanf("%d",&n);
		for(int i=1;i<=n;i++)
			scanf("%d%d",&pos[i].x,&pos[i].y);
		sort(pos+1,pos+n+1,cmp);
		int temp=0,time=0;
		for(int i=1;i<=n;i++)
		{
			if(pos[i].y-time>=abs(pos[i].x-temp))
			{time+=abs(pos[i].x-temp);temp=pos[i].x;}
			else {a[t]=1;break;}//ANNAN
		}
	}
	for(int i=1;i<=g;i++)
	{
		if(a[i]==1) printf("Notabletocatch\n");
		else printf("Abletocatch\n");
		
	}
	return 0;
}

2020/12/13 00:06
加载中...