您当前的位置: 首页 > 

MangataTS

暂无认证

  • 0浏览

    0关注

    423博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

真真真真真签到题(计算几何)

MangataTS 发布时间:2022-02-09 12:59:11 ,浏览量:0

题目链接

https://ac.nowcoder.com/acm/contest/23479/H

题面

在这里插入图片描述

思路

因为紫先做出选择并且希望离小红尽可能近那么紫只有在正方体的正中心才能达到期望最近,而小红后手选择,并且想尽可能远离紫,那么小红一定是选择8个顶点之一,因为其他的都比这个近,所以我们就能得到这个正方体的边长= 2 × x ( 3 ) \frac{2\times x}{\sqrt(3)} ( ​3)2×x​,则我们要求的正方体体积就为: 8 × x 3 3 × ( 3 ) \frac{8\times x^3}{3\times \sqrt(3)} 3×( ​3)8×x3​

代码
#include
using namespace std;
//----------------自定义部分----------------
#define ll long long
#define mod 1000000007
#define endl "\n"
#define PII pair
#define INF 0x3f3f3f3f

int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};

ll ksm(ll a,ll b) {
	ll ans = 1;
	for(;b;b>>=1LL) {
		if(b & 1) ans = ans * a % mod;
		a = a * a % mod;
	}
	return ans;
}

ll lowbit(ll x){return -x & x;}

const int N = 2e6+10;
//----------------自定义部分----------------
int n,m,q,a[N];
double x;
int main()
{
	scanf("%lf",&x);
	x *= 2.0;
	x = x * x * x;
	printf("%.5lf\n",x /(3.0 * sqrt(3)));
	return 0;
}
关注
打赏
1665836431
查看更多评论
立即登录/注册

微信扫码登录

0.0355s