Language: C++

// AOJ 2013

#include <iostream>

using namespace std;

int data[24][60][60];

int main(void)
{
	int n;
	while (cin >> n, n){
		for (int i = 0; i < 24; i++){
			for (int j = 0; j < 60; j++){
				for (int k = 0; k < 60; k++){
					data[i][j][k] = 0;
				}
			}
		}

		int s[3], e[3];
		for (int i = 0; i < n; i++){
			scanf("%d:%d:%d %d:%d:%d", &s[0], &s[1], &s[2], &e[0], &e[1], &e[2]);
			int h = s[0], m = s[1], sec = s[2];
			data[h][m][sec] += 1;
			while (1){
				if (h == e[0] && m == e[1] && sec == e[2]){
					data[h][m][sec]--;
					break;
				}
				sec++;
				if (sec == 60){
					m++;
					sec = 0;
				}
				if (m == 60){
					h++;
					m = 0;
				}
				data[h][m][sec] += 1;
			}
		}
/*
		for (int i = 0; i < 24; i++){
			for (int j = 0; j < 60; j++){
				int cnt = 0;
				for (int k = 0; k < 60; k++){
					cnt = max(cnt, data[i][j][k]);
				}
				cout << cnt << " ";
			}
			puts("");
		}
*/
		int ret = 0;
		for (int i = 0; i < 24; i++){
			for (int j = 0; j < 60; j++){
				for (int k = 0; k < 60; k++){
					ret = max(ret, data[i][j][k]);
				}
			}
		}
		cout << ret << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:41: error: reference to 'data' is ambiguous
   16 |                                         data[i][j][k] = 0;
      |                                         ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:7:5: note:                 'int data [24][60][60]'
    7 | int data[24][60][60];
      |     ^~~~
a.cc:25:25: error: reference to 'data' is ambiguous
   25 |                         data[h][m][sec] += 1;
      |                         ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:7:5: note:                 'int data [24][60][60]'
    7 | int data[24][60][60];
      |     ^~~~
a.cc:28:41: error: reference to 'data' is ambiguous
   28 |                                         data[h][m][sec]--;
      |                                         ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:7:5: note:                 'int data [24][60][60]'
    7 | int data[24][60][60];
      |     ^~~~
a.cc:40:33: error: reference to 'data' is ambiguous
   40 |                                 data[h][m][sec] += 1;
      |                                 ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:7:5: note:                 'int data [24][60][60]'
    7 | int data[24][60][60];
      |     ^~~~
a.cc:59:56: error: reference to 'data' is ambiguous
   59 |                                         ret = max(ret, data[i][j][k]);
      |                                                        ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:7:5: note:                 'int data [24][60][60]'
    7 | int data[24][60][60];
      |     ^~~~