Submission #7285596


Source Code Expand

Copy
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>

using namespace std;

int N;

long long int x[105], y[105];

int used[105];

long long int  dis(long long int x, long long int y) {
	return x*x + y*y;
}

int main(void) {

	cin >> N;

	long long int ans = 0;

	for (int i = 1; i <= N; i++) {
		cin >> x[i] >> y[i];
	}


	long long int X, Y;

	for (int i = 1; i <= N; i++) {

		for (int j = 1; j <= N; j++) { used[i] = 0; }

		X = x[i]; Y = y[i]; used[i] = 1; 
		
		ans = max(ans, dis(X, Y)); 
		for (int j = 1; j <= N; j++) {
			if (used[j] == 1) { continue; }
			if (dis(X, Y) < dis(X + x[j], Y + y[j])) { used[j] = 1; X += x[j]; Y += y[j]; ans = max(ans,dis(X, Y)); }
		}
	}

	long double ANS;

	
	ANS = sqrt(1.0L*ans);

	cout << setprecision(15) << fixed << ANS << endl;

	return 0;
}

Submission Info

Submission Time
Task F - Engines
User LEE_0102
Language C++14 (GCC 5.4.1)
Score 0
Code Size 885 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:48:21: error: ‘sqrt’ was not declared in this scope
  ANS = sqrt(1.0L*ans);
                     ^