题目来源:
http://opentrains.snarknews.info/~ejudge/team.cgi?contest_id=001417
训练时间:2016.08.19 12:10 - 17:10
题面:20160819.pdf
A
题意:给你a,b,n,c,d,m,问你满足条件的x有多少个?
解法:只要判断x^n^(m/gcd)和x^m^(n/gcd)相不相等,相等答案为gcd,否则无解。
C
题意:给出你三角形的三条边,问你在这个三角形中面积最大的椭圆的焦距以及长半轴分别是多少。
公式题:过程参见本人博客
http://blog.csdn.net/qq_28236309/article/details/52253249
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define INF 0x3f3f3f3f
#define eps 1e-6
typedef long long LL;
const double pi = acos(-1.0);
const long long mod = 1e9 + 2015;
using namespace std;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(0);
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
double a,b,c;
cin >> a >> b >> c;
double m = sqrt(a * a + b * b + c * c
+ 2 * sqrt(a * a * a * a + b * b * b * b + c * c * c * c
- b * b * c * c - a * a * c * c - a * a * b * b)) / 6;
double n = sqrt(a * a + b * b + c * c
- 2 * sqrt(a * a * a * a + b * b * b * b + c * c * c * c
- b * b * c * c - a * a * c * c - a * a * b * b)) / 6;
printf("%.12f %.12f\n",2 * sqrt(m * m - n * n),m);
return 0;
}