Submission #1098430

#TimeUsernameProblemLanguageResultExecution timeMemory
1098430dark_369Balloons (CEOI11_bal)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> #ifndef ONLINE_JUDGE #include "dark_369.h" #else #define debug(...) #define debugArr(...) #endif #pragma comment(linker, "/stack:256000000") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define ll long long int #define ld long double #define mp make_pair #define pb push_back #define all(x) (x).begin(), (x).end() #define sz(x) ((ll)x.size()) #define endl "\n" #define pi 3.1415926535897932384626 #define lp(n,v) for(ll i=0;i<n;i++){ll x; cin >> x; v.emplace_back(x);} #define YES cout << "YES" << endl #define NO cout << "NO" << endl #define Yes cout << "Yes" << endl #define No cout << "No" << endl using namespace std; // using namespace __gnu_pbds; const ll N = 1e5 + 10; const ll M = 1e9 + 7; const ll inf = 1e18 + 10; const ld eps = 1e-9; ll dx[] = {1,0,-1,0}; ll dy[] = {0,1,0,-1}; // template<class T> // using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>; // find_by_order() order_of_key() ll binexp(ll a,ll b){ ll res = 1; while(b){ if(b&1){ res = (res * a)%M; } a = (a*a)%M; b >>= 1; } return res; } double calc(pair<double,double> p1,pair<double,double> p2){ double sq = (p1.first - p2.first)*(p1.first - p2.first); double divi = 4.0 * p1.second; sq /= divi; return sq; } void Solve(){ ll n; cin >> n; stack<pair<double,double>> st; for(ll i = 0 ; i < n ; i ++){ pair<double,double> p; cin >> p.first >> p.second; while(!st.empty()){ double r1 = calc(st.top(),p); p.second = min(r1,p.second); if(p.second >= st.top().second){ st.pop(); continue; } else break; } cout << fixed << setprecision(3) << p.second << endl; st.push(p); } } int main() { // auto begin = std::chrono::high_resolution_clock::now(); ios_base::sync_with_stdio(false); cin.tie(NULL); ll t = 1; // cin >> t; // freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout); for (ll i = 1; i <= t; i++) { // cout << "Case #" << i << ": "; Solve(); } // auto end = std::chrono::high_resolution_clock::now(); // auto elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end - begin); // cerr << "Time measured: " << elapsed.count() * 1e-9 << " seconds.\n"; return 0; }

Compilation message (stderr)

bal.cpp:5:10: fatal error: dark_369.h: No such file or directory
    5 | #include "dark_369.h"
      |          ^~~~~~~~~~~~
compilation terminated.