话题已被作者删除

可能存在这样的情况,操作类型为 1 的man和操作类型为 2 的man在某种规则下应该是交替排列或者有特定的先后顺序,简单反转会破坏这种顺序。你看下是不是

@黄耀民 那我除了反转应该没有问题了,那反转该怎么改?

哇栗子酱好像在线那我让栗子酱帮我调一下吧 @栗子酱 (主要是金杭东巨佬睡觉去了 qwq

啊,我看看

哇张乐凡也在线 @张乐凡 帮我一下呗 qwq,主要是金杭东巨佬去睡觉了

哇王语道也在线 @稻叶昙

会不会你想的有点复杂?就是道模拟……

@严梓恩 怎么了模拟怎么了你是不是没有大国猪国杀(我这个已经不复杂了,算了看在你还是基础

等我一阵,找点东西

没想到你居然还写(英文名忘了)表达式这种东西啊

@稻叶昙 啥意思?

没事我以为那个表达式没人写呢,老师上课提过一嘴

@稻叶昙 所以我错在哪里了?

不知道555这种思路我都挺难想的

如果对g的遍历不理解我加了一下注释:

#include<bits/stdc++.h>
#define I using
#define AK namespace
#define IOI std
#define i_ak return
#define ioi  0
I AK IOI;
int n,w,h;
struct node{
	int x,y;
};
struct per{
	int id,op,p,t,cha; 
	node en;
}a[200005];
unordered_map<int,vector<int> >g;
int main(){
	//freopen("","r",stdin);
	//freopen("","w",stdout);
	cin>>n>>w>>h;
	vector<node>ans(n+1);
	for(int i=1;i<=n;i++){
		cin>>a[i].op>>a[i].p>>a[i].t;
		a[i].id=i;
		a[i].cha=a[i].t-a[i].p;
		if(a[i].op==1)a[i].en={w,a[i].p};
		else a[i].en={a[i].p,h};
		g[a[i].cha].push_back(i);
	}
	for(auto it:g){
		vector<int>op1,op2;
		for(auto i:it.second){
			if(a[i].op==1)op1.push_back(i);//如果方向是第一类则加入op1 
			else op2.push_back(i);//如果方向是第二类则加入op2
		}
		sort(op1.begin(),op1.end(),[&](int t1,int t2){
			return a[t1].p<a[t2].p;
		});//将op1按照p升序排序 
		sort(op2.begin(),op2.end(),[&](int t1,int t2){
			return a[t1].p>a[t2].p;
		});//将op2按照p降序排序 
		vector<int>s;
		s.insert(s.end(),op1.begin(),op1.end());
		s.insert(s.end(),op2.begin(),op2.end());
		//将所有点加入s 
		vector<node>res;
		for(auto f:s)res.push_back(a[f].en);//将s中的所有点的终点加入res 
		reverse(res.begin(),res.end());//将res反转 
		for(int j=0;j<s.size();j++)ans[a[s[j]].id]=res[j];//将res按照id顺序加入ans 
	}
	for(int i=1;i<=n;i++)cout<<ans[i].x<<' '<<ans[i].y<<endl;
	i_ak ioi;
}

@王建力

话说你是不是没有考虑开始走的时间

@稻叶昙 这个我考虑了呀,这个东西用方程组一带就能退出一个更奇妙的式子根本不用考虑时间

@稻叶昙 这个式子是:当两个人能相遇的充要条件是 a_t-a_p=b_t-b_p

今天有巨佬帮忙吗?