Language: C

//#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;
using p = pair<int, int>;
using Graph = vector<vector<char>>;
#define rep(i,n)  for(int i = 0; i < n ; i++)
#define chmax(x,y) x = max(x,y);
int dx[4]{ -1,0,1,0 };
int dy[4]{ 0,1,0,-1 };
const ll INF = 1e18;
// auto mod int int で入れてmodで割った値を返すLibrary
const int  mod = 1000000007;
struct mint {
	ll x;
	mint(ll x = 0) :x((x% mod + mod) % mod) {}
	mint operator -() const { return mint(-x); }
	mint& operator +=(const mint a) {
		if ((x += a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator -=(const mint a) {
		if ((x += mod - a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator*= (const mint a) { (x *= a.x) %= mod; return *this; }
	mint operator+(const mint a)const { return mint(*this) += a; }
	mint operator-(const mint a)const { return mint(*this) -= a; }
	mint operator*(const mint a)const { return mint(*this) *= a; }

	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}
	// for prime mode
	mint inv() const { return pow(mod - 2); }
	mint& operator /= (const mint a) { return *this *= a.inv(); }
	mint operator / (const mint a) const { return mint(*this) /= a; }
};
istream& operator >>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator <<(ostream& os, const mint& a) { return os << a.x; }

ll sum(ll l, ll r) {
	return (1 + r) * (r - l + 1) / 2;
}

int main() {
	int n, k;
	cin >> n >> k;
	mint ans;
	for (int i = 0; i <= n+1; i++)
	{
		ll l = sum(0, i - 1), r = sum(n - i + 1, n);
		ans += r - l + 1;
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
main.c:3:1: error: unknown type name 'using'
    3 | using namespace std;
      | ^~~~~
main.c:3:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    3 | using namespace std;
      |                 ^~~
main.c:4:1: error: unknown type name 'using'
    4 | using ll = long long;
      | ^~~~~
main.c:4:12: error: expected expression before 'long'
    4 | using ll = long long;
      |            ^~~~
main.c:5:1: error: unknown type name 'using'
    5 | using ld = long double;
      | ^~~~~
main.c:5:12: error: expected expression before 'long'
    5 | using ld = long double;
      |            ^~~~
main.c:6:1: error: unknown type name 'using'
    6 | using p = pair<int, int>;
      | ^~~~~
main.c:6:11: error: 'pair' undeclared here (not in a function)
    6 | using p = pair<int, int>;
      |           ^~~~
main.c:6:16: error: expected expression before 'int'
    6 | using p = pair<int, int>;
      |                ^~~
main.c:7:1: error: unknown type name 'using'
    7 | using Graph = vector<vector<char>>;
      | ^~~~~
main.c:7:15: error: 'vector' undeclared here (not in a function)
    7 | using Graph = vector<vector<char>>;
      |               ^~~~~~
main.c:7:29: error: expected expression before 'char'
    7 | using Graph = vector<vector<char>>;
      |                             ^~~~
main.c:10:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   10 | int dx[4]{ -1,0,1,0 };
      |          ^
main.c:11:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   11 | int dy[4]{ 0,1,0,-1 };
      |          ^
main.c:12:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'INF'
   12 | const ll INF = 1e18;
      |          ^~~
main.c:16:9: error: expected specifier-qualifier-list before 'll'
   16 |         ll x;
      |         ^~
main.c:44:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '&' token
   44 | istream& operator >>(istream& is, const mint& a) { return is >> a.x; }
      |        ^
main.c:45:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '&' token
   45 | ostream& operator <<(ostream& os, const mint& a) { return os << a.x; }
      |        ^
main.c:47:1: error: unknown type name 'll'
   47 | ll sum(ll l, ll r) {
      | ^~
main.c:47:8: error: expected declaration specifiers or '...' before 'll'
   47 | ll sum(ll l, ll r) {
      |        ^~
main.c:47:14: error: expected declaration specifiers or '...' before 'll'
   47 | ll sum(ll l, ll r) {
      |              ^~
main.c: In function 'main':
main.c:53:9: error: 'cin' undeclared (first use in this function)
   53 |         cin >> n >> k;
      |         ^~~
main.c:53:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:54:9: error: unknown type name 'mint'; use 'struct' keyword to refer to the type
   54 |         mint ans;
      |         ^~~~
      |         struct 
main.c:57:19: error: expected ';' before 'l'
   57 |                 ll l = sum(0, i - 1), r = sum(n - i + 1, n);
      |                   ^~
      |                   ;
main.c:58:24: error: 'r' undeclared (first use in this function)
   58 |                 ans += r - l + 1;
      |                        ^
main.c:58:28: error: 'l' undeclared (first use in this function)
   58 |                 ans += r - l + 1;
      |                            ^
main.c:60:9: error: 'cout' undeclared (first use in this function)
   60 |         cout << ans << endl;
      |         ^~~~
main.c:60:24: error: 'endl' undeclared (first use in this function)
   60 |         cout << ans << endl;
      |                        ^~~~