Language: C++

/*input
9
*/
/*
FIND YOUR PURPOSE BECOME UNSTOPPABLE.
                    ,.
                  ,_> `.   ,';
              ,-`'      `'   '`'._
            ,,-) ---._   |   .---''`-),.
          ,'      `.  \  ;  /   _,'     `,
      ,--' ____       \   '  ,'    ___  `-,
      _>   /--. `-.              .-'.--\   \__
    '-,  (    `.  `.,`~ \~'-. ,' ,'    )    _\
    _<    \     \ ,'  ') )   `. /     /    <,.
  ,-'   _,  \    ,'    ( /      `.    /        `-,
  `-.,-'     `.,'       `         `.,'  `\    ,-'
  ,'       _  /   ,,,      ,,,     \     `-. `-._
  /-,     ,'  ;   ' _ \    / _ `     ; `.     `(`-\
  /-,        ;    (o)      (o)      ;          `'`,
,~-'  ,-'    \     '        `      /     \      <_
/-. ,'        \                   /       \     ,-'
  '`,     ,'   `-/             \-' `.      `-. <
    /_    /      /   (_     _)   \    \          `,
      `-._;  ,' |  .::.`-.-' :..  |       `-.    _\
        _/       \  `:: ,^. :.:' / `.        \,-'
      '`.   ,-'  /`-..-'-.-`-..-'\            `-.
        >_ /     ;  (\/( ' )\/)  ;     `-.    _<
        ,-'      `.  \`-^^^-'/  ,'        \ _<
        `-,  ,'   `. `"""""' ,'   `-.   <`'
          ')        `._.,,_.'        \ ,-'
            '._        '`'`'   \       <
              >   ,'       ,   `-.   <`'
                `,/          \      ,-`
                `,   ,' |   /     /
                  '; /   ;        (
                  _)|   `       (
                  `')         .-'
                    <_   \   /    
                      \   /\(
                        `;/  `
*/
#include <bits/stdc++.h>
#define endl "\n"
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvl vector < vll >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001
#define all(c) c.begin(),c.end()
#define mem(a,val) memset(a,val,sizeof(a))
#define eb emplace_back
#define sz(a) int((a).size())
#define pb push_back
#define tr(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())     
#define rep(i,j,n) for(ll i=j;i<n;i++)
#define mp make_pair
#define N 998244353
#define PI acos(-1.0)
//if (s.find('R') != std::string::npos)
//s.replace(s.find("10"), sizeof("10") - 1, "");
using namespace std;
ll gcd(ll a,ll b){
  if(b==0) return a;
  return gcd(b,a%b);
}
bool compare(const pair<ll, ll>&i, const pair<ll, ll>&j)
  {
    if(i.first+i.second==j.first+j.second) return i.first>j.first;
    return i.first+i.second>j.first+j.second;
  }
bool isPrime(ll j)
{
  if(j==2)
    return true;
  if(j%2==0)
    return false;
  for(ll i=3;i*i<=j;i=i+2)
    if(j%i==0)
    return false;
  return true;
}
bool isSubSequence(string str1, string str2, int m, int n) 
{ 
  int j = 0; // For index of str1 (or subsequence 

  // Traverse str2 and str1, and compare current character  
  // of str2 with first unmatched char of str1, if matched  
  // then move ahead in str1 
  for (int i=0; i<n&&j<m; i++) 
    if (str1[j] == str2[i]) 
      j++; 

  // If all characters of str1 were found in str2 
  return (j==m); 
} 

long long  int exponentiation(long long  int base, long long  int exp) 
{ 
  if (exp == 0) 
    return 1; 

  if (exp == 1) 
    return base % N; 
  long long int t = exponentiation(base, exp / 2); 
  t = (t * t); 
  if (exp % 2 == 0) 
    return t;
  else  
    return ((base ) * t) ; 
} 
ll digit(ll n){
  ll c=0;
  while(n){
    n=n/10;
    c++;
  }
  return c;

}
ll countDigit(long long n) 
{ 
    return floor(log10(n) + 1); 
} 
int main()
{
  // added the two lines below 
  ios_base::sync_with_stdio (false); 
  cin.tie(NULL);
  cout.tie(0);

  int N, L; cin >> N >> L;
	int m = 100000;
	int sum = 0;
	int ans;
	for (int i = 1; i <= N; i++) {
		int t = L + i - 1;
		if (m > abs(t)) {
			ans = t;
			m = abs(t);
		}
		sum += t;
	}
	cout << sum - ans;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:62:11: error: expected unqualified-id before numeric constant
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:7: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |       ^
a.cc:136:17: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
  136 |   int N, L; cin >> N >> L;
      |             ~~~ ^~
      |             |
      |             std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:42:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  170 |       operator>>(bool& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:170:7: note:   conversion of argument 1 would be ill-formed:
a.cc:62:11: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int'
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:20: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |                    ^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
  174 |       operator>>(short& __n);
      |       ^~~~~~~~
/usr/include/c++/14/istream:174:7: note:   conversion of argument 1 would be ill-formed:
a.cc:62:11: warning: overflow in conversion from 'int' to 'short int' changes value from '998244353' to '1' [-Woverflow]
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:20: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |                    ^
a.cc:62:11: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type 'int'
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:20: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |                    ^
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  177 |       operator>>(unsigned short& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:177:7: note:   conversion of argument 1 would be ill-formed:
a.cc:62:11: warning: unsigned conversion from 'int' to 'short unsigned int' changes value from '998244353' to '1' [-Woverflow]
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:20: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |                    ^
a.cc:62:11: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type 'int'
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:20: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |                    ^
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
  181 |       operator>>(int& __n);
      |       ^~~~~~~~
/usr/include/c++/14/istream:181:7: note:   conversion of argument 1 would be ill-formed:
a.cc:62:11: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:20: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |                    ^
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  184 |       operator>>(unsigned int& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:184:7: note:   conversion of argument 1 would be ill-formed:
a.cc:62:11: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type 'int'
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:20: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |                    ^
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  188 |       operator>>(long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:188:7: note:   conversion of argument 1 would be ill-formed:
a.cc:62:11: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type 'int'
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:20: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |                    ^
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  192 |       operator>>(unsigned long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:192:7: note:   conversion of argument 1 would be ill-formed:
a.cc:62:11: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type 'int'
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:20: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |                    ^
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  199 |       operator>>(long long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:199:7: note:   conversion of argument 1 would be ill-formed:
a.cc:62:11: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type 'int'
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:20: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |                    ^
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  203 |       operator>>(unsigned long long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:203:7: note:   conversion of argument 1 would be ill-formed:
a.cc:62:11: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type 'int'
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:20: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |                    ^
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  219 |       operator>>(float& __f)
      |       ^~~~~~~~
/usr/include/c++/14/istream:219:7: note:   conversion of argument 1 would be ill-formed:
a.cc:62:11: error: cannot bind non-const lvalue reference of type 'float&' to a value of type 'int'
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:20: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |                    ^
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  223 |       operator>>(double& __f)
      |       ^~~~~~~~
/usr/include/c++/14/istream:223:7: note:   conversion of argument 1 would be ill-formed:
a.cc:62:11: error: cannot bind non-const lvalue reference of type 'double&' to a value of type 'int'
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:20: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |                    ^
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  227 |       operator>>(long double& __f)
      |       ^~~~~~~~
/usr/include/c++/14/istream:227:7: note:   conversion of argument 1 would be ill-formed:
a.cc:62:11: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type 'int'
   62 | #define N 998244353
      |           ^~~~~~~~~
a.cc:136:20: note: in expansion of macro 'N'
  136 |   int N, L; cin >> N >> L;
      |                    ^
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  328 |       operator>>(void*& __p)
      |       ^~~~~~~~
/usr/include/c++/14/istream:328:7: note:   conversion of argument 1 would be ill-formed:
a.cc:62:11: error: invalid conversion from 'int' to 'void*' [-fpermissive]
   62 | #define N 998244353
      |           ^~~