safety.cpp:11:124: error: stray '#' in program
11 | using namespace std;typedef pair<int,int> PII;int f(int k, int b, int x){ return k*x+b;}int k, x, b, y, sum;signed main(){ #ifdef LOCAL ifstream cin("input.txt"); ofstream cout("output.txt"); #endif fast_io; int n, h; cin >> n >> h; vec < int > q(n); vec < int > w; for(auto &i: q) cin >> i, sum += i; multiset < int > one; multiset < int > two; int left = 0; int right = 0; for(int i = 0; i < n; ++i){ one.insert(q[i]-left); one.insert(q[i]-left); while(sz(one) > sz(two)){ auto it = one.end(); it--; int adder = *it; adder -= right; adder += left; two.insert(adder); one.erase(one.find(*it)); } auto it = one.end(); it--; while((*it)+left > (*two.begin())+right){ two.insert(*it+left-right); one.erase(it); one.insert(*two.begin()+right-left); two.erase(two.begin()); it = one.end(); it--; } left -= h; right += h; } left += h; right -= h; vec < int > fin; for(auto &i: one) fin.pb(i+left); for(auto &i: two) fin.pb(i+right); b = -sum; for(int i = 0; i < n; ++i) b -= i*h; k = n; int ans = 1e18; for(int i = sz(fin)-1; i >= 0; --i){ x = fin[i]; if(x < (int)(1e16/abs(k))){ y = k*x+b; ans = min(ans, y); } k--; b += x; } cout << ans; return 0;}
| ^
safety.cpp:11:195: error: stray '#' in program
11 | using namespace std;typedef pair<int,int> PII;int f(int k, int b, int x){ return k*x+b;}int k, x, b, y, sum;signed main(){ #ifdef LOCAL ifstream cin("input.txt"); ofstream cout("output.txt"); #endif fast_io; int n, h; cin >> n >> h; vec < int > q(n); vec < int > w; for(auto &i: q) cin >> i, sum += i; multiset < int > one; multiset < int > two; int left = 0; int right = 0; for(int i = 0; i < n; ++i){ one.insert(q[i]-left); one.insert(q[i]-left); while(sz(one) > sz(two)){ auto it = one.end(); it--; int adder = *it; adder -= right; adder += left; two.insert(adder); one.erase(one.find(*it)); } auto it = one.end(); it--; while((*it)+left > (*two.begin())+right){ two.insert(*it+left-right); one.erase(it); one.insert(*two.begin()+right-left); two.erase(two.begin()); it = one.end(); it--; } left -= h; right += h; } left += h; right -= h; vec < int > fin; for(auto &i: one) fin.pb(i+left); for(auto &i: two) fin.pb(i+right); b = -sum; for(int i = 0; i < n; ++i) b -= i*h; k = n; int ans = 1e18; for(int i = sz(fin)-1; i >= 0; --i){ x = fin[i]; if(x < (int)(1e16/abs(k))){ y = k*x+b; ans = min(ans, y); } k--; b += x; } cout << ans; return 0;}
| ^
safety.cpp: In function 'int main()':
safety.cpp:11:125: error: 'ifdef' was not declared in this scope
11 | using namespace std;typedef pair<int,int> PII;int f(int k, int b, int x){ return k*x+b;}int k, x, b, y, sum;signed main(){ #ifdef LOCAL ifstream cin("input.txt"); ofstream cout("output.txt"); #endif fast_io; int n, h; cin >> n >> h; vec < int > q(n); vec < int > w; for(auto &i: q) cin >> i, sum += i; multiset < int > one; multiset < int > two; int left = 0; int right = 0; for(int i = 0; i < n; ++i){ one.insert(q[i]-left); one.insert(q[i]-left); while(sz(one) > sz(two)){ auto it = one.end(); it--; int adder = *it; adder -= right; adder += left; two.insert(adder); one.erase(one.find(*it)); } auto it = one.end(); it--; while((*it)+left > (*two.begin())+right){ two.insert(*it+left-right); one.erase(it); one.insert(*two.begin()+right-left); two.erase(two.begin()); it = one.end(); it--; } left -= h; right += h; } left += h; right -= h; vec < int > fin; for(auto &i: one) fin.pb(i+left); for(auto &i: two) fin.pb(i+right); b = -sum; for(int i = 0; i < n; ++i) b -= i*h; k = n; int ans = 1e18; for(int i = sz(fin)-1; i >= 0; --i){ x = fin[i]; if(x < (int)(1e16/abs(k))){ y = k*x+b; ans = min(ans, y); } k--; b += x; } cout << ans; return 0;}
| ^~~~~
safety.cpp:11:196: error: 'endif' was not declared in this scope
11 | using namespace std;typedef pair<int,int> PII;int f(int k, int b, int x){ return k*x+b;}int k, x, b, y, sum;signed main(){ #ifdef LOCAL ifstream cin("input.txt"); ofstream cout("output.txt"); #endif fast_io; int n, h; cin >> n >> h; vec < int > q(n); vec < int > w; for(auto &i: q) cin >> i, sum += i; multiset < int > one; multiset < int > two; int left = 0; int right = 0; for(int i = 0; i < n; ++i){ one.insert(q[i]-left); one.insert(q[i]-left); while(sz(one) > sz(two)){ auto it = one.end(); it--; int adder = *it; adder -= right; adder += left; two.insert(adder); one.erase(one.find(*it)); } auto it = one.end(); it--; while((*it)+left > (*two.begin())+right){ two.insert(*it+left-right); one.erase(it); one.insert(*two.begin()+right-left); two.erase(two.begin()); it = one.end(); it--; } left -= h; right += h; } left += h; right -= h; vec < int > fin; for(auto &i: one) fin.pb(i+left); for(auto &i: two) fin.pb(i+right); b = -sum; for(int i = 0; i < n; ++i) b -= i*h; k = n; int ans = 1e18; for(int i = sz(fin)-1; i >= 0; --i){ x = fin[i]; if(x < (int)(1e16/abs(k))){ y = k*x+b; ans = min(ans, y); } k--; b += x; } cout << ans; return 0;}
| ^~~~~