题意:求表达式中最大的值。

long double 128位 有效数字18-19 范围正负1.2*10^4932

注意取对数!

 #include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<cstdio>
#include<set>
#include<map>
#include<vector>
#include<cstring>
#include<stack>
#include<cmath>
#include<queue>
#include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define ll long long
#define clc(a,b) memset(a,b,sizeof(a))
const int maxn=; const char s[][]=
{
"x^y^z",
"x^z^y",
"(x^y)^z",
"(x^z)^y",
"y^x^z",
"y^z^x",
"(y^x)^z",
"(y^z)^x",
"z^x^y",
"z^y^x",
"(z^x)^y",
"(z^y)^x"
}; int main()
{
long double a[];
long double x,y,z;
cin>>x>>y>>z;
a[]=pow(y,z)*log(x);
a[]=pow(z,y)*log(x);
a[]=a[]=y*z*log(x);
a[]=pow(x,z)*log(y);
a[]=pow(z,x)*log(y);
a[]=a[]=x*z*log(y);
a[]=pow(x,y)*log(z);
a[]=pow(y,x)*log(z);
a[]=a[]=x*y*log(z);
int pos=;
for(int i=; i<=; i++)
{
if(a[i]>a[pos])
pos=i;
}
printf("%s\n",s[pos]);
return ;
}

codeforce 621D - Rat Kwesh and Cheese的更多相关文章

  1. Codeforces Round #341 (Div. 2) D. Rat Kwesh and Cheese 数学

    D. Rat Kwesh and Cheese 题目连接: http://www.codeforces.com/contest/621/problem/D Description Wet Shark ...

  2. 【17.00%】【codeforces 621D】Rat Kwesh and Cheese

    time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  3. Codeforces Round #341 Div.2 D. Rat Kwesh and Cheese

    嗯本来想着直接算出来不就行了吗 然后我想到了200^200^200....... 好吧其实也不难取两次log就行了 然后我第一次写出来log就写残了........... log里面的拆分要仔细啊.. ...

  4. Codeforces Round #341 (Div. 2)

    在家都变的懒惰了,好久没写题解了,补补CF 模拟 A - Wet Shark and Odd and Even #include <bits/stdc++.h> typedef long ...

  5. Codeforces Round #341 (Div. 2) ABCDE

    http://www.cnblogs.com/wenruo/p/5176375.html A. Wet Shark and Odd and Even 题意:输入n个数,选择其中任意个数,使和最大且为奇 ...

  6. Backtracking algorithm: rat in maze

    Sept. 10, 2015 Study again the back tracking algorithm using recursive solution, rat in maze, a clas ...

  7. CF 371B Fox Dividing Cheese[数论]

    B. Fox Dividing Cheese time limit per test 1 second memory limit per test 256 megabytes input standa ...

  8. hdu 1078 FatMouse and Cheese

    Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission( ...

  9. Codeforce - Street Lamps

    Bahosain is walking in a street of N blocks. Each block is either empty or has one lamp. If there is ...

随机推荐

  1. 【加密】C#.NET 各种加密解密

    包括:AES/DES/Base64/RSA/MD5/SHA256 http://www.sosuo8.com/article/show.asp?id=3083 http://blog.csdn.net ...

  2. Xilium.CefGlue利用XHR实现Js调用c#方法

    防外链 博客园原文地址在这里http://www.cnblogs.com/shen6041/p/3442499.html 引 Xilium CefGlue是个不错的cef扩展工程,托管地址在这里 ht ...

  3. hdu 2594 Simpsons’ Hidden Talents KMP应用

    Simpsons’ Hidden Talents Problem Description Write a program that, when given strings s1 and s2, fin ...

  4. BZOJ 2124等差子序列 线段树&&hash

    [题目描述 Description] 给一个 1 到 N 的排列{Ai},询问是否存在 1<=p1<p2<p3<p4<p5<…<pLen<=N(Len& ...

  5. Vm image download resource

    http://vmdepot.msopentech.com/List/Index http://www.hanselman.com/blog/Over400VirtualMachineImagesOf ...

  6. 认识变量------JAVA

    声明变量: variables must have a type variables must have a name int count // type int //count name 变量就是杯 ...

  7. Tesseract 3 语言数据的训练方法

    OCR,光学字符识别 光学字符识别(OCR,Optical Character Recognition)是指对文本资料进行扫描,然后对图像文件进行分析处理,获取文字及版面信息的过程.OCR技术非常专业 ...

  8. BZOJ 3956 Count 解题报告

    好点对的个数是\(O(n)\)的,而且我们可以 \(O(n)\) 地求出所有好点对. 我们把这些点对以右端点为关键字从小到大排序,再弄个扫描线,每次把右端点在扫描线上的点对的左端点加入线段树,于是我们 ...

  9. 盘点六大在中国复制失败的O2O案例

    O2O概念自2010年11月被引入中国以来被各方迅速炒热,各种分类信息网站.点评类网站.团购类网站.订餐类网站等都开始宣称自己为O2O模式.O2O最基本的解释是通过线上引导流量去线下体验和消费,从这个 ...

  10. distinct 去重复查询——两个表join 连接,去掉重复的数据

    ------distinct 去重复查询 select * from  accounts acc join (select distinct accid from roles) r on r.acci ...