Language: C++

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<queue>
#include<vector>
using namespace std;

#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL


typedef struct {
	int s;
	int g;
	bool f;
}time;
void swap_time(time *x, time *y) {
	time tmp = *x;
	*x = *y;
	*y = tmp;
}
void sort_by_s(time a[], int n) {
	for (int i = 0; i < n - 1; i++) {
		for (int j = 0; j > i; j--) {
			if (a[j - 1].s > a[j].s)
				swap_time(&a[j], &a[j - 1]);
		}
	}
}
int main() {
	int n, hhs, mms, sss, hhg, mmg, ssg, cnt = 1;
	time yamanote[10000];
	while (1) {
		cin >> n;
		if (n == 0)break;
		for (int i = 0; i < n; i++) {
			char c;
			cin >> hhs >> c >> mms >> c >> sss >> hhg >> c >> mmg >> c >> ssg;
			yamanote[i].s = 3600 * hhs + 60 * mms + sss;
			yamanote[i].g = 3600 * hhg + 60 * mmg + ssg;
		}
		sort_by_s(yamanote,n);
		for (int i = 1; i < n; i++) {
			for (int j = 0; j < i;j++) {
				if (yamanote[j].f == 1) { break; }
				if (yamanote[i].s >= yamanote[j].g) {
					yamanote[j].f = 1;
					break;
				}
				if (j == i)cnt++;
			}
		}
		cout << cnt << endl;
		cnt = 1;
	}
	return 0;
}

Compiler output:
a.cc:30:2: error: 'typedef struct time time' redeclared as different kind of entity
   30 | }time;
      |  ^~~~
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc:31:6: error: variable or field 'swap_time' declared void
   31 | void swap_time(time *x, time *y) {
      |      ^~~~~~~~~
a.cc:31:22: error: 'x' was not declared in this scope
   31 | void swap_time(time *x, time *y) {
      |                      ^
a.cc:31:31: error: 'y' was not declared in this scope; did you mean 'yn'?
   31 | void swap_time(time *x, time *y) {
      |                               ^
      |                               yn
a.cc:36:6: error: variable or field 'sort_by_s' declared void
   36 | void sort_by_s(time a[], int n) {
      |      ^~~~~~~~~
a.cc:36:20: error: expected ')' before 'a'
   36 | void sort_by_s(time a[], int n) {
      |               ~    ^~
      |                    )
a.cc:36:26: error: expected primary-expression before 'int'
   36 | void sort_by_s(time a[], int n) {
      |                          ^~~
a.cc: In function 'int main()':
a.cc:46:13: error: expected ';' before 'yamanote'
   46 |         time yamanote[10000];
      |             ^~~~~~~~~
      |             ;
a.cc:53:25: error: 'yamanote' was not declared in this scope
   53 |                         yamanote[i].s = 3600 * hhs + 60 * mms + sss;
      |                         ^~~~~~~~
a.cc:56:27: error: 'yamanote' was not declared in this scope
   56 |                 sort_by_s(yamanote,n);
      |                           ^~~~~~~~
a.cc:56:17: error: 'sort_by_s' was not declared in this scope
   56 |                 sort_by_s(yamanote,n);
      |                 ^~~~~~~~~