제출 #1123377

#제출 시각아이디문제언어결과실행 시간메모리
1123377hihihihawBalloons (CEOI11_bal)C++20
10 / 100
155 ms1964 KiB
#pragma GCC optimize("O3,unroll-loops,fast-math") #include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define pii pair<int, int> #define sz(v) (int)v.size() #define fi first #define se second #define INF 999999992000000023 #define MOD 1000000007 #define cint(x) int x;cin >> x; #define cinarr(a, n) int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; #define coutarr(a) for (auto d : a){cout << d << " ";} cout << endl; #define coutarrD(a) for (auto d : a) {cout << d.fi << "," << d.se << " "; }cout << endl; #define BERKAY_TUP ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define endl '\n' #define ld long double #define mid (start + end) / 2 #define vvi vector<vector<int>> int t=1; int interactive=0; int usaco=0; int testCase=0; void solve(){ int n; cin>>n; stack<pair<ld,ld>> ss; for (int i=0;i<n;i++){ ld x,r; cin>>x>>r; ld mn=r; while (sz(ss)){ auto d=ss.top(); if (min(((d.fi-x)*(d.fi-x))/(4*d.se),r)<d.se){ mn=min(((d.fi-x)*(d.fi-x))/(4*d.se),r); break; } ss.pop(); } ss.push({x,mn}); cout<<mn<<fixed<<setprecision(3)<<endl; } } int32_t main(){ BERKAY_TUP; if (usaco) { freopen("newbarn.in", "r", stdin); freopen("newbarn.out", "w", stdout); } if (!interactive) { #ifdef Local freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); // freopen("wormsort.out", "w", stdout); #endif } if (t == 1) solve(); else { cin >> t; while (t--) { testCase++; solve(); } } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

bal.cpp: In function 'int32_t main()':
bal.cpp:56:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   56 |         freopen("newbarn.in", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
bal.cpp:57:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   57 |         freopen("newbarn.out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...