标签:priority intern hat use ike def amp 优先队列 contains
Time Limit: 1000MS | Memory Limit: 30000K | |
Total Submissions: 18198 | Accepted: 8175 |
Description
Input
Output
Sample Input
3 72 30 50
Sample Output
120.000
Source
#include<iostream> #include<stdio.h> #include<vector> #include<queue> #include<cmath> using namespace std; #define LL long long using namespace std; const int N = 20000+100; int n; double L; double a,b; priority_queue<double> q; int main() { cin>>n; for(int i=0;i<n;i++) { cin>>L; q.push(L); } while(q.size()>1) { a=q.top();q.pop(); b=q.top();q.pop(); q.push(2*sqrt(a*b)); } printf("%.3f\n",q.top()); return 0; }
POJ 1862 Stripies【哈夫曼/贪心/优先队列】
标签:priority intern hat use ike def amp 优先队列 contains
原文地址:http://www.cnblogs.com/Roni-i/p/7912555.html