Submission #1167561

#TimeUsernameProblemLanguageResultExecution timeMemory
1167561LmaoLmaoBalloons (CEOI11_bal)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#define fi first
#define se second
#define name ""
#define double long double
#define int long long
using namespace std;

using ll = long long;
using ii = pair<ll, ll>;
using aa = array<int,3>;

long double a[200005][2];

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen(name".inp", "r", stdin);
    //freopen(name".out", "w", stdout);
    int n;
    cin >> n;
    stack<int> st;
    for(int i=1;i<=n;i++) {
      cin >> a[i][0] >> a[i][1];
      long double r=a[i][1];
      while(!st.empty()) {
        int cur=st.top();
        long double res=(a[cur][0]-a[i][0])*(a[cur][0]-a[i][0])/(4*a[cur][1]);
        r=min(r,res);
        if(r<a[cur][1]) break;
        st.pop();
      }
      st.push(i);
      a[i][1]=r;
      cout << r << endl;
    }
    return 0;
}

/*
██╗░░██╗██╗░░██╗░█████╗░███╗░░██╗░██████╗░              ░██████╗██╗██╗░░░██╗                ░█████╗░██╗░░░██╗████████╗███████╗
██║░██╔╝██║░░██║██╔══██╗████╗░██║██╔════╝░              ██╔════╝██║██║░░░██║                ██╔══██╗██║░░░██║╚══██╔══╝██╔════╝
█████═╝░███████║███████║██╔██╗██║██║░░██╗░              ╚█████╗░██║██║░░░██║                ██║░░╚═╝██║░░░██║░░░██║░░░█████╗░░
██╔═██╗░██╔══██║██╔══██║██║╚████║██║░░╚██╗              ░╚═══██╗██║██║░░░██║                ██║░░██╗██║░░░██║░░░██║░░░██╔══╝░░
██║░╚██╗██║░░██║██║░░██║██║░╚███║╚██████╔╝              ██████╔╝██║╚██████╔╝                ╚█████╔╝╚██████╔╝░░░██║░░░███████╗
╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝░╚═════╝░              ╚═════╝░╚═╝░╚═════╝░                ░╚════╝░░╚═════╝░░░░╚═╝░░░╚══════╝
*/

Compilation message (stderr)

bal.cpp:5:16: error: 'long long' specified with 'double'
    5 | #define double long double
      |                ^~~~
bal.cpp:13:6: note: in expansion of macro 'double'
   13 | long double a[200005][2];
      |      ^~~~~~
bal.cpp: In function 'int main()':
bal.cpp:5:16: error: 'long long' specified with 'double'
    5 | #define double long double
      |                ^~~~
bal.cpp:26:12: note: in expansion of macro 'double'
   26 |       long double r=a[i][1];
      |            ^~~~~~
bal.cpp:5:16: error: 'long long' specified with 'double'
    5 | #define double long double
      |                ^~~~
bal.cpp:29:14: note: in expansion of macro 'double'
   29 |         long double res=(a[cur][0]-a[i][0])*(a[cur][0]-a[i][0])/(4*a[cur][1]);
      |              ^~~~~~