【㵘】【违规紫衫】关于膜拜Siyuan的真理II
  • 板块灌水区
  • 楼主jjltcl_ac
  • 当前回复8
  • 已保存回复8
  • 发布时间2021/2/18 00:15
  • 上次更新2023/11/5 03:08:04
查看原帖
【㵘】【违规紫衫】关于膜拜Siyuan的真理II
416720
jjltcl_ac楼主2021/2/18 00:15

bdfs无果

#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main()
{
	int ansx=0,ansy=0,ansz=0;
	double ans=114514;
	for(int x=0;x<=50;x++)
		for(int y=0;y<=50;y++)
			for(int z=0;z<=50;z++)
			{
//				cout<<x<<" "<<y<<" "<<z;
				double dis=ceil(sqrt((x)*(x)+(y)*(y)+(z)*(z)));
//				cout<<"差距:"<<ans<<endl;
				if(abs(41-dis)<abs(41-ans)) ansx=x,ansy=y,ansz=z,ans=dis,cout<<ansx<<" "<<ansy<<" "<<ansz<<endl;
			}
	cout<<ansx<<" "<<ansy<<" "<<ansz<<" ";
	return 0;
}

有大佬帮忙康康代码错在哪里啊啊啊

2021/2/18 00:15
加载中...