답안 #576355

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
576355 2022-06-13T04:25:09 Z Benqt Balloons (CEOI11_bal) Java 11
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

const int INF = 1000000000;
const ll LINF = (ll) INF * (ll) INF;
const ld DINF = (ld) INF * (ld) INF;

int main() {
	int n;
	cin >> n;
	vector<pair<ld, ld>> arr(n);
	for (int i=0; i<n; i++) {
		cin >> arr[i].first; //x coord
		cin >> arr[i].second; //radius
	}

	pair<ld, ld> big_r = arr[0];
	pair<ld, ld> big_h = arr[0];

	for (int i=1; i<n; i++) {
		ld h1 = arr[i].first - big_h.first;
		ld r1 = (h1 * h1)/(4 * big_h.second);

		ld h2 = arr[i].first - big_r.first;
		ld r2 = (h2 * h2)/(4 * big_r.second);
		//cout << r1 << " " << r2 << endl;

		arr[i].second = min(arr[i].second, min(r1, r2));

		big_h = arr[i];
		if (arr[i].second > big_r.second) {
			big_r = arr[i];
		}
	}
	cout << setprecision(20);
	for (int i=0; i<n; i++) {
		cout << arr[i].second << endl;
	}
}

Compilation message

bal.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
bal.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
bal.java:5: error: class, interface, or enum expected
typedef long long ll;
^
bal.java:6: error: class, interface, or enum expected
typedef long double ld;
^
bal.java:8: error: class, interface, or enum expected
const int INF = 1000000000;
^
bal.java:9: error: class, interface, or enum expected
const ll LINF = (ll) INF * (ll) INF;
^
bal.java:10: error: class, interface, or enum expected
const ld DINF = (ld) INF * (ld) INF;
^
bal.java:12: error: class, interface, or enum expected
int main() {
^
bal.java:14: error: class, interface, or enum expected
	cin >> n;
	^
bal.java:15: error: class, interface, or enum expected
	vector<pair<ld, ld>> arr(n);
	^
bal.java:16: error: class, interface, or enum expected
	for (int i=0; i<n; i++) {
	^
bal.java:16: error: class, interface, or enum expected
	for (int i=0; i<n; i++) {
	              ^
bal.java:16: error: class, interface, or enum expected
	for (int i=0; i<n; i++) {
	                   ^
bal.java:18: error: class, interface, or enum expected
		cin >> arr[i].second; //radius
		^
bal.java:19: error: class, interface, or enum expected
	}
	^
bal.java:22: error: class, interface, or enum expected
	pair<ld, ld> big_h = arr[0];
	^
bal.java:24: error: class, interface, or enum expected
	for (int i=1; i<n; i++) {
	^
bal.java:24: error: class, interface, or enum expected
	for (int i=1; i<n; i++) {
	              ^
bal.java:24: error: class, interface, or enum expected
	for (int i=1; i<n; i++) {
	                   ^
bal.java:26: error: class, interface, or enum expected
		ld r1 = (h1 * h1)/(4 * big_h.second);
		^
bal.java:28: error: class, interface, or enum expected
		ld h2 = arr[i].first - big_r.first;
		^
bal.java:29: error: class, interface, or enum expected
		ld r2 = (h2 * h2)/(4 * big_r.second);
		^
bal.java:32: error: class, interface, or enum expected
		arr[i].second = min(arr[i].second, min(r1, r2));
		^
bal.java:34: error: class, interface, or enum expected
		big_h = arr[i];
		^
bal.java:35: error: class, interface, or enum expected
		if (arr[i].second > big_r.second) {
		^
bal.java:37: error: class, interface, or enum expected
		}
		^
bal.java:40: error: class, interface, or enum expected
	for (int i=0; i<n; i++) {
	^
bal.java:40: error: class, interface, or enum expected
	for (int i=0; i<n; i++) {
	              ^
bal.java:40: error: class, interface, or enum expected
	for (int i=0; i<n; i++) {
	                   ^
bal.java:42: error: class, interface, or enum expected
	}
	^
30 errors