Submission #1156830

#TimeUsernameProblemLanguageResultExecution timeMemory
1156830gulmixArt Exhibition (JOI18_art)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; using ll = long long; #define all(x) x.begin(), x.end() #define oset tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> int main(){ ios::sync_with_stdio(false); cin.tie(0); //ifstream cin("inputf.txt"); //ofstream cout("outputfv.txt"); ll n; cin >> n; vector<pair<ll, ll>> a(n); for(int i = 0; i < n; i++){ cin >> a[i].first >> a[i].second; } sort(all(a)); ll cur = 0; ll ans = 0; ll mn = a[0].first, mx = a[0].first; for(int i = 0; i < n; i++){ mn = min(a[i].first, mn); mx = max(a[i].first, mx); cur += a[i].second; if(cur - (mx - mn) < 0){ cur = 0; mn = a[i].first; mx = a[i].first; i--; continue; } mn = mn1; mx = mx1; ans = max(ans, cur - (mx - mn)); } cout << ans << '\n'; }

Compilation message (stderr)

art.cpp: In function 'int main()':
art.cpp:34:14: error: 'mn1' was not declared in this scope; did you mean 'mn'?
   34 |         mn = mn1; mx = mx1;
      |              ^~~
      |              mn
art.cpp:34:24: error: 'mx1' was not declared in this scope; did you mean 'mx'?
   34 |         mn = mn1; mx = mx1;
      |                        ^~~
      |                        mx