Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 5;
typedef long long ll;
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); } 
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
struct info {
	char opt;
	int i, j, k;
};
vector <info> ans; int v[MAXN];
void check() {
	read(v[0]), read(v[1]);
	for (auto x : ans) {
		if (x.opt == '<') v[x.i] = v[x.j] < v[x.k];
		else v[x.i] = v[x.j] + v[x.k];
	}
	cerr << v[2] << endl;
}
int a, b, res, p, q, one, zero, size;
void inc(int x) {
	ans.push_back((info) {'+', x, x, one});
}
int cmp(int x, int y) {
	ans.push_back((info) {'<', ++size, x, y});
	return size;
}
void update(int x, int y) {
	ans.push_back((info) {'+', ++size, x, y});
	int cur = size;
	ans.push_back((info) {'<', ++size, one, cur});
	ans.push_back((info) {'+', res, res, size});
}
int getone() {
	int x = size + 1;
	ans.push_back((info) {'+', ++size, a, b});
	ans.push_back((info) {'<', ++size, zero, x});
	return size;
}
int main() {
	int n = 10; a = 0, b = 1, res = 2, p = 3, zero = size = 4;
	one = getone();
	for (int i = 1; i <= n; i++) {
		q = ++size;
		for (int j = 1; j <= n; j++) {
			update(cmp(p, a), cmp(q, b));
			inc(q);
		}
		inc(p);
	}
	cout << ans.size() << endl;
	for (auto x : ans) printf("%c %d %d %d\n", x.opt, x.i, x.j, x.k);
	//check();
	return 0;
}


Compiler output:
a.cc: In function 'int cmp(int, int)':
a.cc:32:28: error: expected primary-expression before ')' token
   32 |         ans.push_back((info) {'<', ++size, x, y});
      |                            ^
a.cc:33:16: error: reference to 'size' is ambiguous
   33 |         return size;
      |                ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:27:33: note:                 'int size'
   27 | int a, b, res, p, q, one, zero, size;
      |                                 ^~~~
a.cc: In function 'void update(int, int)':
a.cc:36:28: error: expected primary-expression before ')' token
   36 |         ans.push_back((info) {'+', ++size, x, y});
      |                            ^
a.cc:37:19: error: reference to 'size' is ambiguous
   37 |         int cur = size;
      |                   ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:27:33: note:                 'int size'
   27 | int a, b, res, p, q, one, zero, size;
      |                                 ^~~~
a.cc:38:28: error: expected primary-expression before ')' token
   38 |         ans.push_back((info) {'<', ++size, one, cur});
      |                            ^
a.cc:39:28: error: expected primary-expression before ')' token
   39 |         ans.push_back((info) {'+', res, res, size});
      |                            ^
a.cc: In function 'int getone()':
a.cc:42:17: error: reference to 'size' is ambiguous
   42 |         int x = size + 1;
      |                 ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:27:33: note:                 'int size'
   27 | int a, b, res, p, q, one, zero, size;
      |                                 ^~~~
a.cc:43:28: error: expected primary-expression before ')' token
   43 |         ans.push_back((info) {'+', ++size, a, b});
      |                            ^
a.cc:44:28: error: expected primary-expression before ')' token
   44 |         ans.push_back((info) {'<', ++size, zero, x});
      |                            ^
a.cc:45:16: error: reference to 'size' is ambiguous
   45 |         return size;
      |                ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:27:33: note:                 'int size'
   27 | int a, b, res, p, q, one, zero, size;
      |                                 ^~~~
a.cc: In function 'int main()':
a.cc:48:58: error: reference to 'size' is ambiguous
   48 |         int n = 10; a = 0, b = 1, res = 2, p = 3, zero = size = 4;
      |                                                          ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:27:33: note:                 'int size'
   27 | int a, b, res, p, q, one, zero, size;
      |                                 ^~~~
a.cc:51:23: error: reference to 'size' is ambiguous
   51 |                 q = ++size;
      |                       ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:27:33: note:                 'int size'
   27 | int a, b, res, p, q, one, zero, size;
      |                                 ^~~~