比赛 EYOI与SBOI开学欢乐赛8th 评测结果 AAAAAAAAAA
题目名称 题目名字 最终得分 100
用户昵称 遥时_彼方 运行时间 0.951 s
代码语言 C++ 内存使用 5.35 MiB
提交时间 2022-09-26 20:20:22
显示代码纯文本
#include<bits/stdc++.h>
#define rep(x,y,z) for(int x=y;x<=z;x++)
#define drep(x,y,z) for(int x=y;x>=z;x--)
#define ull unsigned long long
#define ll long long
using namespace std;
inline int read()
{
	int x=0;bool flag=1;char ch=getchar();
	while(ch<'0'||ch>'9') {if(ch=='-')flag=0;ch=getchar();}
	while(ch>='0'&&ch<='9') {x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}
	if(flag) return x;
	return ~(x-1);
} 
inline void write(int x)
{
	if(x<0) {x=~(x-1);putchar('-');}
	if(x>9) write(x/10);
	putchar(x%10+'0');
}
//
const int N=1e6+50;
int nc;
ll n[N];
int main()
{
    freopen("Unnamed_Problem.in","r",stdin);
	freopen("Unnamed_Problem.out","w",stdout);
    nc=read();
    rep(i,1,nc) n[i]=read();
    sort(n+1,n+1+nc);
    ll b=n[nc],a=n[1],c=n[2];
    cout<<min(c-(b*b/(4*a)),a-(b*b/(4*c)))<<endl;
    return 0;
}