Language: C++

int main() {
	while (1) {
		int N; cin >> N;
		if (!N)break;
		int sx, sy, tx, ty; cin >> sx >> sy >> tx >> ty;
		Point start(sx, sy);
		Point goal(tx, ty);
		vector<Circle>cs;
		for (int i = 0; i < N; ++i) {
			int x, y, r; cin >> x >> y >> r;
			cs.emplace_back(Point(x, y), r);
		}
		vector<pair<Circle, int>>starts, goals;
		for (int i = 0; i < N; ++i) {
			if (is_in_circle(cs[i], start) == 2) {
				starts.push_back(make_pair(cs[i], 1));
			}
			else if (is_in_circle(cs[i], goal) == 2) {
				goals.push_back(make_pair(cs[i], 1));
			}
		}
		{
			vector<vector<int>>edges(starts.size());
			vector<vector<int>>revedges(starts.size());
			vector<int>nums(starts.size());
			for (int i = 0; i < starts.size(); ++i) {
				for (int j = 0; j < starts.size(); ++j) {
					if (i == j)continue;
					else {
						if (circle_in_circle(starts[i].first, starts[j].first) == 2) {
							edges[i].push_back(j);
							nums[j]++;
						}
					}
				}
			}
			queue<pair<int, int>>que;
			for (int i = 0; i < starts.size(); ++i) {
				if (nums[i] == 0) {
					que.push(make_pair(i, starts[i].second));
				}
			}

			while (!que.empty()) {
				auto p(que.front());
				que.pop();
				const int from = p.first;
				const int nownum = p.second;
				for (auto e : edges[from]) {
					starts[e].second = max(starts[e].second, nownum + 1);
					nums[e]--;
					if (!nums[e]) {
						que.push(make_pair(e, starts[e].second));
					}
				}
			}
		}
		{
			vector<vector<int>>edges(goals.size());
			vector<vector<int>>revedges(goals.size());
			vector<int>nums(goals.size());
			for (int i = 0; i < goals.size(); ++i) {
				for (int j = 0; j < goals.size(); ++j) {
					if (i == j)continue;
					else {
						if (circle_in_circle(goals[i].first, goals[j].first) == 2) {
							edges[i].push_back(j);
							nums[j]++;
						}
					}
				}
			}
			queue<pair<int, int>>que;
			for (int i = 0; i < goals.size(); ++i) {
				if (nums[i] == 0) {
					que.push(make_pair(i, goals[i].second));
				}
			}

			while (!que.empty()) {
				auto p(que.front());
				que.pop();
				const int from = p.first;
				const int nownum = p.second;
				for (auto e : edges[from]) {
					goals[e].second = max(goals[e].second, nownum + 1);
					nums[e]--;
					if (!nums[e]) {
						que.push(make_pair(e, goals[e].second));
					}
				}
			}
		}
		int ans = 0;
		for (auto s : starts) {
			ans = max(ans, s.second);
			for (auto g : goals) {
				if (abs(s.first.p - g.first.p) < s.first.r + g.first.p - eps) {
					ans = max(ans, s.second + g.second);
				}
			}
		}
		for (auto g : goals) {
			ans = max(ans, g.second);
		}
		cout << ans << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:24: error: 'cin' was not declared in this scope
    3 |                 int N; cin >> N;
      |                        ^~~
a.cc:6:17: error: 'Point' was not declared in this scope; did you mean 'int'?
    6 |                 Point start(sx, sy);
      |                 ^~~~~
      |                 int
a.cc:7:22: error: expected ';' before 'goal'
    7 |                 Point goal(tx, ty);
      |                      ^~~~~
      |                      ;
a.cc:8:17: error: 'vector' was not declared in this scope
    8 |                 vector<Circle>cs;
      |                 ^~~~~~
a.cc:8:24: error: 'Circle' was not declared in this scope
    8 |                 vector<Circle>cs;
      |                        ^~~~~~
a.cc:8:31: error: 'cs' was not declared in this scope
    8 |                 vector<Circle>cs;
      |                               ^~
a.cc:13:24: error: 'pair' was not declared in this scope
   13 |                 vector<pair<Circle, int>>starts, goals;
      |                        ^~~~
a.cc:13:37: error: expected primary-expression before 'int'
   13 |                 vector<pair<Circle, int>>starts, goals;
      |                                     ^~~
a.cc:15:49: error: 'start' was not declared in this scope
   15 |                         if (is_in_circle(cs[i], start) == 2) {
      |                                                 ^~~~~
a.cc:15:29: error: 'is_in_circle' was not declared in this scope
   15 |                         if (is_in_circle(cs[i], start) == 2) {
      |                             ^~~~~~~~~~~~
a.cc:16:33: error: 'starts' was not declared in this scope
   16 |                                 starts.push_back(make_pair(cs[i], 1));
      |                                 ^~~~~~
a.cc:16:50: error: 'make_pair' was not declared in this scope
   16 |                                 starts.push_back(make_pair(cs[i], 1));
      |                                                  ^~~~~~~~~
a.cc:18:54: error: 'goal' was not declared in this scope
   18 |                         else if (is_in_circle(cs[i], goal) == 2) {
      |                                                      ^~~~
a.cc:19:33: error: 'goals' was not declared in this scope
   19 |                                 goals.push_back(make_pair(cs[i], 1));
      |                                 ^~~~~
a.cc:19:49: error: 'make_pair' was not declared in this scope
   19 |                                 goals.push_back(make_pair(cs[i], 1));
      |                                                 ^~~~~~~~~
a.cc:23:39: error: expected primary-expression before 'int'
   23 |                         vector<vector<int>>edges(starts.size());
      |                                       ^~~
a.cc:24:39: error: expected primary-expression before 'int'
   24 |                         vector<vector<int>>revedges(starts.size());
      |                                       ^~~
a.cc:25:32: error: expected primary-expression before 'int'
   25 |                         vector<int>nums(starts.size());
      |                                ^~~
a.cc:26:45: error: 'starts' was not declared in this scope
   26 |                         for (int i = 0; i < starts.size(); ++i) {
      |                                             ^~~~~~
a.cc:30:53: error: 'circle_in_circle' was not declared in this scope
   30 |                                                 if (circle_in_circle(starts[i].first, starts[j].first) == 2) {
      |                                                     ^~~~~~~~~~~~~~~~
a.cc:31:57: error: 'edges' was not declared in this scope
   31 |                                                         edges[i].push_back(j);
      |                                                         ^~~~~
a.cc:32:57: error: 'nums' was not declared in this scope
   32 |                                                         nums[j]++;
      |                                                         ^~~~
a.cc:37:25: error: 'queue' was not declared in this scope
   37 |                         queue<pair<int, int>>que;
      |                         ^~~~~
a.cc:37:36: error: expected primary-expression before 'int'
   37 |                         queue<pair<int, int>>que;
      |                                    ^~~
a.cc:38:45: error: 'starts' was not declared in this scope
   38 |                         for (int i = 0; i < starts.size(); ++i) {
      |                                             ^~~~~~
a.cc:39:37: error: 'nums' was not declared in this scope
   39 |                                 if (nums[i] == 0) {
      |                                     ^~~~
a.cc:40:41: error: 'que' was not declared in this scope
   40 |                                         que.push(make_pair(i, starts[i].second));
      |                                         ^~~
a.cc:40:50: error: 'make_pair' was not declared in this scope
   40 |                                         que.push(make_pair(i, starts[i].second));
      |                                                  ^~~~~~~~~
a.cc:44:33: error: 'que' was not declared in this scope
   44 |                         while (!que.empty()) {
      |                                 ^~~
a.cc:49:47: error: 'edges' was not declared in this scope
   49 |                                 for (auto e : edges[from]) {
      |                                               ^~~~~
a.cc:50:41: error: 'starts' was not declared in this scope
   50 |                                         starts[e].second = max(starts[e].second, nownum + 1);
      |                                         ^~~~~~
a.cc:50:60: error: 'max' was not declared in this scope
   50 |                                         starts[e].second = max(starts[e].second, nownum + 1);
      |                                                            ^~~
a.cc:51:41: error: 'nums' was not declared in this scope
   51 |                                         nums[e]--;
      |                                         ^~~~
a.cc:53:58: error: 'make_pair' was not declared in this scope
   53 |                                                 que.push(make_pair(e, starts[e].second));
      |                                                          ^~~~~~~~~
a.cc:59:39: error: expected primary-expression before 'int'
   59 |                         vector<vector<int>>edges(goals.size());
      |                                       ^~~
a.cc:60:39: error: expected primary-expression before 'int'
   60 |                         vector<vector<int>>revedges(goals.size());
      |                                       ^~~
a.cc:61:32: error: expected primary-expression before 'int'
   61 |                         vector<int>nums(goals.size());
      |                                ^~~
a.cc:62:45: error: 'goals' was not declared in this scope
   62 |                         for (int i = 0; i < goals.size(); ++i) {
      |                                             ^~~~~
a.cc:66:53: error: 'circle_in_circle' was not declared in this scope
   66 |                                                 if (circle_in_circle(goals[i].first, goals[j].first) == 2) {
      |                                                     ^~~~~~~~~~~~~~~~
a.cc:67:57: error: 'edges' was not declared in this scope
   67 |                                                         edges[i].push_back(j);
      |                                                         ^~~~~
a.cc:68:57: error: 'nums' was not declared in this scope
   68 |                                                         nums[j]++;
      |                                                         ^~~~
a.cc:73:25: error: 'queue' was not declared in this scope
   73 |                         queue<pair<int, int>>que;
      |                         ^~~~~
a.cc:73:36: error: expected primary-expression before 'int'
   73 |                         queue<pair<int, int>>que;
      |                                    ^~~
a.cc:74:45: error: 'goals' was not declared in this scope
   74 |                         for (int i = 0; i < goals.size(); ++i) {
      |                                             ^~~~~
a.cc:75:37: error: 'nums' was not declared in this scope
   75 |                                 if (nums[i] == 0) {
      |                                     ^~~~
a.cc:76:41: error: 'que' was not declared in this scope
   76 |                                         que.push(make_pair(i, goals[i].second));
      |                                         ^~~
a.cc:76:50: error: 'make_pair' was not declared in this scope
   76 |                                         que.push(make_pair(i, goals[i].second));
      |                                                  ^~~~~~~~~
a.cc:80:33: error: 'que' was not declared in this scope
   80 |                         while (!que.empty()) {
      |                                 ^~~
a.cc:85:47: error: 'edges' was not declared in this scope
   85 |                                 for (auto e : edges[from]) {
      |                                               ^~~~~
a.cc:86:41: error: 'goals' was not declared in this scope
   86 |                                         goals[e].second = max(goals[e].second, nownum + 1);
      |                                         ^~~~~
a.cc:86:59: error: 'max' was not declared in this scope
   86 |                                         goals[e].second = max(goals[e].second, nownum + 1);
      |                                                           ^~~
a.cc:87:41: error: 'nums' was not declared in this scope
   87 |                                         nums[e]--;
      |                                         ^~~~
a.cc:89:58: error: 'make_pair' was not declared in this scope
   89 |                                                 que.push(make_pair(e, goals[e].second));
      |                                                          ^~~~~~~~~
a.cc:95:31: error: 'starts' was not declared in this scope
   95 |                 for (auto s : starts) {
      |                               ^~~~~~
a.cc:96:31: error: 'max' was not declared in this scope
   96 |                         ans = max(ans, s.second);
      |