Language: C++

//My life was going great until I stumble upon this question ); ):

#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

long long MOD = 1000000007; //1e9+7
long long INF = 1e18;
typedef long long ll;
typedef long double ld;
#define pii		pair<int, int>
#define pll		pair<long long, long long>
#define fi 		first
#define se 		second
#define fr(i,a,b) 	for(int i=a;i<b;i++)
#define out2(a,b) 	cout<<a<<" "<<b<<"\n";
#define all(v) 		v.begin(), v.end()
#define pb          	emplace_back

void solve()
{
    ll n, k;
    ll m = 998244353;
    cin>>n>>k;
    ll arr[k][2];
    vector<ll> dp(n+1, 0), pre(n+2, 0);
    for(int i=0;i<k;i++){
        cin>>arr[i][0]>>arr[i][1];
    }
    dp[1]=pre[1]=1;
    ll l, r;
    for(int i=2;i<=n;i++){
        for(int j=0;j<k;j++){
            if(i<arr[j][0]) continue;
            l = arr[j][0];
            r = min(arr[j][1], i-1);
            dp[i] = (dp[i] + pre[i-l]-pre[i-r-1] + m)%m;
        }
        pre[i] = (pre[i-1]+dp[i])%m;
        //cout<<dp[i]<<" ";
    }
    cout<<dp[n]%m;
}

int main() {
	FIO;
	//freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
	int test;
	//cin>>test;
	test=1;
	for(int t=1;t<=test;t++){
        //cout<<"Case #"<<t<<": ";
        solve();
        //cout<<ans<<"\n";
	}
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:36:20: error: no matching function for call to 'min(ll&, int)'
   36 |             r = min(arr[j][1], i-1);
      |                 ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:36:20: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   36 |             r = min(arr[j][1], i-1);
      |                 ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:36:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   36 |             r = min(arr[j][1], i-1);
      |                 ~~~^~~~~~~~~~~~~~~~