Dance with a stick 题解(思维)
作者:互联网
题目链接
题目思路
居然是个imo题目链接 感觉应该不会再有了吧。。。。
结论就是经过某个点的直线,使得左右两侧的点个数相同
向量取\((-1,1e9)\)
代码
#include<bits/stdc++.h>
#define fi first
#define se second
#define debug cout<<"I AM HERE"<<endl;
using namespace std;
typedef long long ll;
const int maxn=2e5+5,inf=0x3f3f3f3f,mod=998244353;
const double eps=1e-6;
int n;
pair<int,int> pa[maxn];
signed main(){
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%d%d",&pa[i].fi,&pa[i].se);
}
sort(pa+1,pa+1+n);
if(n%2==1){
printf("Yes\n");
printf("%d %d -1 1000000000\n",pa[n/2+1].fi,pa[n/2+1].se);
}else{
printf("No\n");
}
return 0;
}
标签:题目,cout,Dance,题解,int,stick,链接,define 来源: https://www.cnblogs.com/hunxuewangzi/p/15138925.html