# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
485119 |
2021-11-06T08:35:08 Z |
hammer23 |
Balloons (CEOI11_bal) |
C++14 |
|
2000 ms |
4384 KB |
#include <bits/stdc++.h>
using namespace std;
/******* All Required define Pre-Processors and typedef Constants *******/
typedef pair<int,int> pii;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define sz(x) (int)(x).size()
#define all(x) x.begin(),x.end()
#define sor(x) sort(all(x))
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pb push_back
#define eb emplace_back
#define pf push_front
#define ll long long
#define numBit(x) __builtin_popcount(x)
#define lb lower_bound
#define ub upper_bound
#define ar array
#define endl '\n'
#define fi first
#define se second
const int inf = 1e9+1;
const int maxN = 2e5 + 1;
const int MOD = 1e9 + 7;
using namespace std;
ll powmod(ll a, ll b, ll p){
a %= p;
if (a == 0) return 0;
ll product = 1;
while(b > 0){
if (b&1){
product *= a;
product %= p;
--b;
}
a *= a;
a %= p;
b /= 2;
}
return product;
}
ll inv(ll a, ll p){
return powmod(a, p-2, p);
}
ll DIVMOD(ll a, ll b, ll p){
// A*(B^(MOD-2))%MOD
return a*inv(b,p)%p;
}
void file(const string FILE = "bongbong") {
//freopen((FILE + ".INP").c_str(), "r", stdin);
//freopen((FILE + ".OUT").c_str(), "w", stdout);
}
int n;
int xx,yy,rr=0;
int x[maxN];
long double r[maxN];
void solve(){
cin>>n;
for(int i=0;i<n;i++){
cin>>x[i]>>r[i];
}
for(int i=0;i<n;i++){
for(int j=i-1;j>=0;j--){
r[i]=min(r[i],((x[i]-x[j])*(x[i]-x[j]))/(4*r[j]));
}
//cout<<ans<<setprecision(3)<<endl;
printf("%.3lf\n", r[i]);
}
}
int main()
{
//file();
fastIO;
int t=1;
//cin>>t;
while(t--)
solve();
return 0;
}
Compilation message
bal.cpp: In function 'void solve()':
bal.cpp:74:21: warning: format '%lf' expects argument of type 'double', but argument 2 has type 'long double' [-Wformat=]
74 | printf("%.3lf\n", r[i]);
| ~~~~^ ~~~~
| | |
| double long double
| %.3Lf
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
1st numbers differ - expected: '24.0000000000', found: '0.0000000000', error = '24.0000000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
332 KB |
1st numbers differ - expected: '247294217.0000000000', found: '0.0000000000', error = '247294217.0000000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
1st numbers differ - expected: '213.0000000000', found: '0.0000000000', error = '213.0000000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
13 ms |
332 KB |
1st numbers differ - expected: '123.0000000000', found: '0.0000000000', error = '123.0000000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1018 ms |
920 KB |
1st numbers differ - expected: '213.0000000000', found: '0.0000000000', error = '213.0000000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2085 ms |
1644 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2093 ms |
2412 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2096 ms |
2712 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2089 ms |
3508 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2095 ms |
4384 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |