Submission #124336

# Submission time Handle Problem Language Result Execution time Memory
124336 2019-07-03T06:23:00 Z rajarshi_basu Art Exhibition (JOI18_art) C++14
Compilation error
0 ms 0 KB
#include <iostream>
#include <vector>
#include <set>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <stdio.h>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <fstream>
#include <complex>
#include <stack>
#include <set>

#define FOR(i,n) for(int i=0;i<n;i++)
#define FORE(i,a,b) for(int i=a;i<=b;i++)
#define ll long long int
#define vi vector<int>
#define ii pair<int,int>
#define pb push_back
#define mp make_pair
#define vv vector
#define ff first
#define ss second
#define pll pair<ll,ll>
#define cd complex<double> 
#define ld long double
#define pld pair<ld,ld>
#define iii pair<ii,int>

using namespace std;

const int INF = 1e9;
const int MAXN = 400+5;
const int MAXK = 100+10;

int main(){
	int n;
	cin >> n;
	vv<pll> all;
	FOR(i,n){
		ll a,b;
		cin >> a >> b;
		all.pb({a,b});
	}
	sort(all.begin(), all.end());
	vv<ll> pref;
	for(auto e : all){
		if(pref.empty())pref.pb(e.ss);
		else pref.pb(pref.back() + e.ss);
	}
	set<ll,geater<ll> > st;st.insert(-all[0].ff);
	ll mx = 0;
	int ptr = 0;
	for(auto e : all){
		mx = max(mx,pref[ptr] - e.ff - *st.begin());
		st.insert(pref[ptr++] - e.ff);
	}
	cout << mx << endl;
	return 0;
}

Compilation message

art.cpp: In function 'int main()':
art.cpp:54:9: error: 'geater' was not declared in this scope
  set<ll,geater<ll> > st;st.insert(-all[0].ff);
         ^~~~~~
art.cpp:54:9: note: suggested alternative: 'gettext'
  set<ll,geater<ll> > st;st.insert(-all[0].ff);
         ^~~~~~
         gettext
art.cpp:54:18: error: template argument 2 is invalid
  set<ll,geater<ll> > st;st.insert(-all[0].ff);
                  ^
art.cpp:54:20: error: expected unqualified-id before '>' token
  set<ll,geater<ll> > st;st.insert(-all[0].ff);
                    ^
art.cpp:54:25: error: 'st' was not declared in this scope
  set<ll,geater<ll> > st;st.insert(-all[0].ff);
                         ^~
art.cpp:54:25: note: suggested alternative: 'ss'
  set<ll,geater<ll> > st;st.insert(-all[0].ff);
                         ^~
                         ss