国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

回復(fù)@7950XT

2022-10-14 16:19 作者:北斗七星魔數(shù)戰(zhàn)隊(duì)  | 我要投稿

@瘋狂的方塊人


#include<bits/stdc++.h>

using namespace std;

int n,m,mn,mx,a[35];

bool c[35];

struct ben{

? ? double x,y;

}p[35],s[35],pp[35];

double check(ben a1,ben a2,ben b1,ben b2){

? ? return (a2.x-a1.x)*(b2.y-b1.y)-(b2.x-b1.x)*(a2.y-a1.y);

}

double d(ben p1,ben p2){

? ? return sqrt((p2.y-p1.y)*(p2.y-p1.y)+(p2.x-p1.x)*(p2.x-p1.x));

}

bool cmp(ben p1,ben p2){

? ? double tmp=check(pp[1],p1,pp[1],p2);

? ? if(tmp>0)?

return 1;

? ? if(tmp==0&&d(pp[0],p1)<d(pp[0],p2))?

return 1;

? ? return 0;

}

int __main(){

? ? int cnnt=1;

? ? for(int iii=1;iii<=n;iii++){

? ? ? ? if(c[iii])pp[cnnt++]=p[iii];

? ? }

? ? for(int i=2;i<=m;i++){

if(pp[i].y<pp[1].y){

? ? ? ? ? ? swap(pp[1].y,pp[i].y);

? ? ? ? ? ? swap(pp[1].x,pp[i].x);

? ? ? ? }

? ? }

? ? sort(pp+2,pp+1+m,cmp);

s[1]=pp[1];

? ? int cnt=1;

? ? for(int i=2;i<=m;i++){

? ? ? ? while(cnt>1&&check(s[cnt-1],s[cnt],s[cnt],pp[i])<=0)

? ? ? ? ? ? cnt--;

? ? ? ? cnt++;

? ? ? ? s[cnt]=pp[i];

? ? }

? ? s[cnt+1]=pp[1];

? ? double ans=0;

? ? for(int i=1;i<=cnt;i++){

ans+=d(s[i],s[i+1]);

? ? }

? ? return(int)(ans);

}

void dfs(int k){

? ? int i;

? ? if(k>m){

? ? ? ? int tmp=__main();

? ? ? ? if(a[k-1]==m){

? ? ? ? mx=tmp,mn=tmp;

}else{

mx=max(mx,tmp);

? ? ? ? mn=min(mn,tmp);

}

? ? ? ? return;

? ? }

? ? for(i=a[k-1]+1;i<=n;i++){

? ? ? ? c[i]=1;

? ? ? ? a[k]=i;

? ? ? ? dfs(k+1);

? ? ? ? a[k]=0;

? ? ? ? c[i]=0;

? ? }

}

int main(){

? ? scanf("%d%d",&n,&m);

? ? if(m==0){

? ? printf("0 0");

? ? exit(0);

}

? ? for(int i=1;i<=n;i++){

? ? ? ? scanf("%lf%lf",&p[i].x,&p[i].y);

? ? }

? ? dfs(1);

? ? printf("%d %d",mn,mx);

? ? return 0;

}


回復(fù)@7950XT的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
漳浦县| 民勤县| 镇远县| 永和县| 德庆县| 大石桥市| 潮州市| 西宁市| 青海省| 密云县| 吉木乃县| 满洲里市| 遂平县| 平舆县| 贺州市| 清原| 宁武县| 扎兰屯市| 莱芜市| 三门县| 正镶白旗| 长乐市| 于田县| 永靖县| 夏河县| 广西| 万宁市| 湛江市| 巩义市| 罗江县| 泉州市| 友谊县| 八宿县| 内江市| 南通市| 弥勒县| 嵩明县| 利津县| 东乡| 宾阳县| 闽侯县|