Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

于是我选择使用iostream,haha~~~

Posted by yousiki at 2016-07-29 08:50:58 on Problem 1862
In Reply To:G++ WA C++ AC的同学请注意%lf需要g++4.8才支持 Posted by:tianyichen at 2016-01-13 15:11:18
#include<queue>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<iomanip>
#include<iostream>
#include<algorithm>
using namespace std;
priority_queue<double>pq;
signed main(void) {
	ios::sync_with_stdio(false);
	int n; cin >> n;
	for (int i = 0, w; i < n; i++)
		cin>>w, pq.push((double)w);
	while (pq.size() > 1) {
		double top1 = pq.top(); pq.pop();
		double top2 = pq.top(); pq.pop();
		pq.push(2 * sqrt(top1*top2));
	}
	cout << fixed << setprecision(3) << pq.top() << endl;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator