Submission #220602

#TimeUsernameProblemLanguageResultExecution timeMemory
220602arnold518Balloons (CEOI11_bal)C++14
100 / 100
191 ms12148 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 2e5; int N; ll X[MAXN+10]; long double R[MAXN+10]; int main() { int i, j; scanf("%d", &N); for(i=1; i<=N; i++) scanf("%lld%Lf", &X[i], &R[i]); vector<int> S; for(i=1; i<=N; i++) { while(!S.empty()) { R[i]=min(R[i], (long double)(X[i]-X[S.back()])*(X[i]-X[S.back()])/(4*R[S.back()])); if(R[i]<=R[S.back()]) break; else S.pop_back(); } S.push_back(i); } for(i=1; i<=N; i++) printf("%.10Lf\n", R[i]); }

Compilation message (stderr)

bal.cpp: In function 'int main()':
bal.cpp:16:9: warning: unused variable 'j' [-Wunused-variable]
  int i, j;
         ^
bal.cpp:18:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &N);
  ~~~~~^~~~~~~~~~
bal.cpp:19:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(i=1; i<=N; i++) scanf("%lld%Lf", &X[i], &R[i]);
                      ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#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...