Language: C++

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef pair<P,ll> PP;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(X,Y) ((X)>(Y)?X=(Y),true:false)
#define chmax(X,Y) ((X)<(Y)?X=(Y),true:false)
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

#define S 31
ll n, C;
vector<PP> v;
ll cnt[S];

ll solve(){
	priority_queue<P, vector<P>, greater<P> > q;
	ll res = 0, time = 0, sz = 0;
	rep(i, n){
		if(q.empty()){
			;
		} else {
			if(time<v[i].fst.fst){
				time = v[i].fst.fst;
				sz = 0;
				mset(cnt, 0);
				while(!q.empty() && v[i].fst.fst>q.top().fst) q.pop();
				while(!q.empty() && v[i].fst.fst==q.top().fst){
					sz++;
					cnt[q.top().snd]++;
					q.pop();
				}
			}
			if(cnt[v[i].snd]){
				sz--;
				cnt[v[i].snd]--;
			}
		}
		q.push(P(v[i].fst.snd, v[i].snd));
		res = max(res, q.size()+sz);
		//cerr<<i<<" "<<res<<endl;
	}
	return res;
}

int main(){
	cin>>n>>C;
	v = vector<PP>(n);
	rep(i, n){
		int s, t, c;
		cin>>s>>t>>c;
		v[i] = PP(P(s, t), c);
	}
	sort(all(v));
	/*ll lb = 0, ub = n;
	  while(ub-lb>1){
	  ll md = (lb+ub+1)/2;
	  (check(md)?ub:lb) = md;
	  }
	  cout<<ub<<endl;
	  */
	cout<<solve()<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'll solve()':
a.cc:71:26: error: no matching function for call to 'max(ll&, long long unsigned int)'
   71 |                 res = max(res, q.size()+sz);
      |                       ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:71:26: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   71 |                 res = max(res, q.size()+sz);
      |                       ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:71:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   71 |                 res = max(res, q.size()+sz);
      |                       ~~~^~~~~~~~~~~~~~~~~~