Submission #535308

#TimeUsernameProblemLanguageResultExecution timeMemory
535308tphuc2908Balloons (CEOI11_bal)C++14
50 / 100
2087 ms4076 KiB
#include<bits/stdc++.h> using namespace std; #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #define rep(i, x, y) for(int i = x; i <= y; ++i) #define repi(i,x,y) for(int i = x; i >= y; --i) #define ci(x) int x; cin>> x #define TC(t) ci(t); while(t--) #define fi first #define se second #define pb push_back #define all(x) x.begin(), x.end() #define cii(x, y) ci(x); ci(y) #define ciii(x, y, z) ci(x); ci(y); ci(z) #define mp make_pair //#define int long long typedef long long ll; typedef vector<int> vi; const int N = 2e5 + 5; const int NN = 16 + 15; const int mod = 998244353; const int mod1 = 1e9 + 9; const int pi = 31; const int inf = 1e9 + 6; const int block = 500; const int dx[4] = {-1, 0, 1, 0}; const int dy[4] = {0, -1, 0, 1}; const int base = 1e9; typedef vector<int> bignum; void readfile(){ #ifdef ONLINE_JUDGE #else freopen("text.inp", "r", stdin); #endif // ONLINE_JUDGE // freopen("text.inp", "r", stdin); // freopen("template.out", "w", stdout); } int n; long long a[N], r[N]; void inp(){ cin >> n; for(int i = 1; i <= n; ++i) cin >> a[i] >> r[i]; } long double res[N]; void process(){ stack<pair<int,double> > st; for(int i = 1; i <= n; ++i){ res[i] = r[i]; for(int j = 1; j < i; ++j){ long long temp1 = (a[i] - a[j]) * 1LL * (a[i] - a[j]); long double temp = temp1; long double rr = temp / (4.0 * res[j]); res[i] = min(res[i], rr); } cout << fixed << setprecision(3) << res[i] << '\n'; } } int main() { // readfile(); ios_base::sync_with_stdio(0); cin.tie(0); // int t; cin >> t >> opt; // while(t--){ inp(); process(); // } return 0; }

Compilation message (stderr)

bal.cpp: In function 'void readfile()':
bal.cpp:35:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |         freopen("text.inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...