Submission #1006794

# Submission time Handle Problem Language Result Execution time Memory
1006794 2024-06-24T08:52:13 Z jor0715 Balloons (CEOI11_bal) C++17
10 / 100
2000 ms 2304 KB
#include <bits/stdc++.h>
using namespace std;

#define MOD 1000000007
#define ll long long
#define endl "\n"
#define range(i,a,b,c) for(int i=a;i!=b;i+=c)
#define vi vector<int>
#define vll vector<ll>

long double r2(int r1, int x1, int x2){
	int dis = abs(x2-x1);
	return 1.0*pow(dis,2)/(4*r1);
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	cout << fixed << setprecision(3);
	
	int N;
	cin >> N;
	vi x(N);
	vi r(N);
	range(i,0,N,1){
		cin >> x[i] >> r[i];
	}
	
	range(i,0,N,1){
		long double minn = r[i];
		range(j,0,i,1){
			minn = min(minn, r2(r[j], x[j], x[i]));
		}
		r[i] = minn;
		cout << minn << endl;
	}
	
	
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 8th numbers differ - expected: '8.7410000000', found: '9.0910000000', error = '0.3500000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB 13th numbers differ - expected: '2.3960000000', found: '2.4500000000', error = '0.0540000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 348 KB 3rd numbers differ - expected: '121.0000000000', found: '121.0020000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1024 ms 620 KB 44th numbers differ - expected: '165.0000000000', found: '165.0020000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2023 ms 856 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2053 ms 1616 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2037 ms 1452 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2012 ms 1876 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2053 ms 2304 KB Time limit exceeded
2 Halted 0 ms 0 KB -