Language: C++

#include <bits/stdc++.h>
using namespace std;

#define lli long long int
#define lli(n) long long int n = 0;
#define ld long double
#define MAX_L lli max = 9000000000000000000;
#define MIN_L lli min = 9000000000000000000;
#define MAX_D ld max = 4500;
#define MIN_D ld min = -4500;
#define LLI(n) \
  lli n;       \
  cin >> n;
#define LD(n)  \
  ld n;        \
  cin > n;
#define LLIV(a, n)            \
  vector<lli> a(n);           \
  for (lli i = 0; i < n; i++) \
  {                           \
    cin >> a.at(i);           \
  };
#define LLIV2(a, b, n)            \
  vector<lli> a(n), b(n);           \
  for (lli i = 0; i < n; i++) \
  {                           \
    cin >> a.at(i) >> b.at(i);           \
  };
#define LDV(a, n)            \
  vector<ld> a(n);           \
  for (lli i = 0; i < n; i++) \
  {                           \
    cin >> a.at(i);           \
  };
#define STR(n) \
  string n;    \
  cin >> n;
#define sum(n) accumulate(n.begin(), n.end(), 0);
#define Sort(n) sort(n.begin(), n.end());
#define Reve(n) reverse(n.begin(), n.end());
#define yes cout << "Yes" << endl; return 0;
#define no cout << "No" << endl; return 0;
#define C45(n) (n + 1) / 2
#define OUT(n) cout << n << endl;
#define SRC(n, c)                    \
  for (lli i = 0; i < s.size(); i++) \
  {                                  \
    if (s.at(i) == c)                \
    {                                \
      n++;                           \
    }                                \
  };
//こぴー
/*#define ZISYO(s, S)                  \
  for (lli i = 0; i < s.size(); i++) \
  {                                  \
    S.at(i) = s.at(i);               \
  }                                  \
  Sort(S) Reve(S) for (lli i = 0; i < s.size(); i++) { s.at(i) = S.at(i); };
*/

//素数
bool IsPrime(lli num)
{
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false;
  long double sqrtNum = sqrt(num);
  for (lli i = 3; i <= sqrtNum; i += 2)
  {
    if (num % i == 0)
      return false;
  }
  return true;
}
//各桁の和
lli KSum(lli n)
{
  lli sum = 0;
  if (n < 0)
    return 0;
  while (n > 0)
  {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

int main(void)
{
  ios::sync_with_stdio(false);
  LLI(K)LLI(S)lli(flag)
  for(lli i = 0;i <= K;i++) {
    for(lli u = 0;u <= K;u++) {
      if(i + u - S <= K) {
        flag++;
      }
    }
  }
  OUT(flag)
}


Compiler output:
a.cc:5:9: warning: "lli" redefined
    5 | #define lli(n) long long int n = 0;
      |         ^~~
a.cc:4:9: note: this is the location of the previous definition
    4 | #define lli long long int
      |         ^~~
a.cc:63:14: error: 'lli' was not declared in this scope
   63 | bool IsPrime(lli num)
      |              ^~~
a.cc:80:1: error: 'lli' does not name a type
   80 | lli KSum(lli n)
      | ^~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'lli' was not declared in this scope
   12 |   lli n;       \
      |   ^~~
a.cc:96:3: note: in expansion of macro 'LLI'
   96 |   LLI(K)LLI(S)lli(flag)
      |   ^~~
a.cc:96:7: error: 'K' was not declared in this scope
   96 |   LLI(K)LLI(S)lli(flag)
      |       ^
a.cc:13:10: note: in definition of macro 'LLI'
   13 |   cin >> n;
      |          ^
a.cc:96:13: error: expected ';' before 'S'
   96 |   LLI(K)LLI(S)lli(flag)
      |             ^
a.cc:12:7: note: in definition of macro 'LLI'
   12 |   lli n;       \
      |       ^
a.cc:96:13: error: 'S' was not declared in this scope
   96 |   LLI(K)LLI(S)lli(flag)
      |             ^
a.cc:13:10: note: in definition of macro 'LLI'
   13 |   cin >> n;
      |          ^
a.cc:97:10: error: expected ';' before 'i'
   97 |   for(lli i = 0;i <= K;i++) {
      |          ^~
      |          ;
a.cc:97:17: error: 'i' was not declared in this scope
   97 |   for(lli i = 0;i <= K;i++) {
      |                 ^
a.cc:98:12: error: expected ';' before 'u'
   98 |     for(lli u = 0;u <= K;u++) {
      |            ^~
      |            ;
a.cc:98:19: error: 'u' was not declared in this scope
   98 |     for(lli u = 0;u <= K;u++) {
      |                   ^